mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-24 13:05:53 +00:00
222 lines
35 KiB
HTML
222 lines
35 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.17"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>rippled: AMMCore.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">rippled
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.17 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_df9c78dcf3f59a33b12284f95992a64b.html">ripple</a></li><li class="navelem"><a class="el" href="dir_1e765e6a8d5970800a535eb2615ec474.html">protocol</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">AMMCore.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//------------------------------------------------------------------------------</span></div>
|
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">/*</span></div>
|
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> This file is part of rippled: https://github.com/ripple/rippled</span></div>
|
|
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> Copyright (c) 2023 Ripple Labs Inc.</span></div>
|
|
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"></span> </div>
|
|
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> Permission to use, copy, modify, and/or distribute this software for any</span></div>
|
|
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> purpose with or without fee is hereby granted, provided that the above</span></div>
|
|
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> copyright notice and this permission notice appear in all copies.</span></div>
|
|
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span> </div>
|
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES</span></div>
|
|
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF</span></div>
|
|
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR</span></div>
|
|
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES</span></div>
|
|
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN</span></div>
|
|
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF</span></div>
|
|
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</span></div>
|
|
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">*/</span></div>
|
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">//==============================================================================</span></div>
|
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  </div>
|
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#ifndef RIPPLE_PROTOCOL_AMMCORE_H_INCLUDED</span></div>
|
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#define RIPPLE_PROTOCOL_AMMCORE_H_INCLUDED</span></div>
|
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  </div>
|
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include <ripple/basics/Number.h></span></div>
|
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <ripple/protocol/AccountID.h></span></div>
|
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <ripple/protocol/Issue.h></span></div>
|
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <ripple/protocol/TER.h></span></div>
|
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <ripple/protocol/UintTypes.h></span></div>
|
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  </div>
|
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">namespace </span><a class="code" href="namespaceripple.html">ripple</a> {</div>
|
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  </div>
|
|
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="namespaceripple.html#ad528aff4d449e3e5e4d0de8d5b2f4cf5"> 31</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> constexpr <a class="code" href="namespaceripple.html#ad528aff4d449e3e5e4d0de8d5b2f4cf5">TRADING_FEE_THRESHOLD</a> = 1000; <span class="comment">// 1%</span></div>
|
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  </div>
|
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment">// Auction slot</span></div>
|
|
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="namespaceripple.html#a2b3a1a7a96fd5ac1d063b50c9f6243dc"> 34</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> constexpr <a class="code" href="namespaceripple.html#a2b3a1a7a96fd5ac1d063b50c9f6243dc">TOTAL_TIME_SLOT_SECS</a> = 24 * 3600;</div>
|
|
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="namespaceripple.html#a3227a0599e217de9084e5fc5bf55ee0c"> 35</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> constexpr <a class="code" href="namespaceripple.html#a3227a0599e217de9084e5fc5bf55ee0c">AUCTION_SLOT_TIME_INTERVALS</a> = 20;</div>
|
|
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="namespaceripple.html#af498a34ec9d23894e9b3f030f4dad716"> 36</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> constexpr <a class="code" href="namespaceripple.html#af498a34ec9d23894e9b3f030f4dad716">AUCTION_SLOT_MAX_AUTH_ACCOUNTS</a> = 4;</div>
|
|
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="namespaceripple.html#aed6dddd4925b3b57d0bb0a5e56e2c9f0"> 37</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> constexpr <a class="code" href="namespaceripple.html#aed6dddd4925b3b57d0bb0a5e56e2c9f0">AUCTION_SLOT_FEE_SCALE_FACTOR</a> = 100000;</div>
|
|
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="namespaceripple.html#abbacd2b60095e80ec98a2a5600779e48"> 38</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> constexpr <a class="code" href="namespaceripple.html#abbacd2b60095e80ec98a2a5600779e48">AUCTION_SLOT_DISCOUNTED_FEE_FRACTION</a> = 10;</div>
|
|
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="namespaceripple.html#a85f9203ae884c72d6b00f9bb5e04a491"> 39</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> constexpr <a class="code" href="namespaceripple.html#a85f9203ae884c72d6b00f9bb5e04a491">AUCTION_SLOT_MIN_FEE_FRACTION</a> = 25;</div>
|
|
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="namespaceripple.html#a358c9d5cf8201cd8d6b847f7ee6cee09"> 40</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> constexpr <a class="code" href="namespaceripple.html#a358c9d5cf8201cd8d6b847f7ee6cee09">AUCTION_SLOT_INTERVAL_DURATION</a> =</div>
|
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <a class="code" href="namespaceripple.html#a2b3a1a7a96fd5ac1d063b50c9f6243dc">TOTAL_TIME_SLOT_SECS</a> / <a class="code" href="namespaceripple.html#a3227a0599e217de9084e5fc5bf55ee0c">AUCTION_SLOT_TIME_INTERVALS</a>;</div>
|
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  </div>
|
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// Votes</span></div>
|
|
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="namespaceripple.html#a2e6fe99974f1e61fc7435209a335a879"> 44</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> constexpr <a class="code" href="namespaceripple.html#a2e6fe99974f1e61fc7435209a335a879">VOTE_MAX_SLOTS</a> = 8;</div>
|
|
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="namespaceripple.html#a9af918dd4f383c5eef731cb372f038e6"> 45</a></span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> constexpr <a class="code" href="namespaceripple.html#a9af918dd4f383c5eef731cb372f038e6">VOTE_WEIGHT_SCALE_FACTOR</a> = 100000;</div>
|
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  </div>
|
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">class </span><a class="code" href="classripple_1_1STObject.html">STObject</a>;</div>
|
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">class </span><a class="code" href="classripple_1_1STAmount.html">STAmount</a>;</div>
|
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="keyword">class </span><a class="code" href="classripple_1_1Rules.html">Rules</a>;</div>
|
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  </div>
|
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <a class="code" href="classripple_1_1base__uint.html">AccountID</a></div>
|
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <a class="code" href="namespaceripple.html#a768092086ea18d2dbeb64efb9fa12ba5">ammAccountID</a>(</div>
|
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> prefix,</div>
|
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& parentHash,</div>
|
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& ammID);</div>
|
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  </div>
|
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <a class="code" href="classripple_1_1base__uint.html">Currency</a></div>
|
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <a class="code" href="namespaceripple.html#a2e120e21ebcb5778e7ead49555f5297f">ammLPTCurrency</a>(<a class="code" href="classripple_1_1base__uint.html">Currency</a> <span class="keyword">const</span>& cur1, <a class="code" href="classripple_1_1base__uint.html">Currency</a> <span class="keyword">const</span>& cur2);</div>
|
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  </div>
|
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <a class="code" href="classripple_1_1Issue.html">Issue</a></div>
|
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <a class="code" href="namespaceripple.html#a5e068ce58638111534101573085f71a2">ammLPTIssue</a>(</div>
|
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <a class="code" href="classripple_1_1base__uint.html">Currency</a> <span class="keyword">const</span>& cur1,</div>
|
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="code" href="classripple_1_1base__uint.html">Currency</a> <span class="keyword">const</span>& cur2,</div>
|
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <a class="code" href="classripple_1_1base__uint.html">AccountID</a> <span class="keyword">const</span>& <a class="code" href="namespaceripple.html#a768092086ea18d2dbeb64efb9fa12ba5">ammAccountID</a>);</div>
|
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  </div>
|
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <a class="code" href="classripple_1_1TERSubset.html">NotTEC</a></div>
|
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <a class="code" href="namespaceripple.html#af0a4cb9a60e337bf81ea735c4bbb0bc2">invalidAMMAmount</a>(</div>
|
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <a class="code" href="classripple_1_1STAmount.html">STAmount</a> <span class="keyword">const</span>& amount,</div>
|
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a><<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<Issue, Issue></a>> <span class="keyword">const</span>& pair = std::nullopt,</div>
|
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordtype">bool</span> validZero = <span class="keyword">false</span>);</div>
|
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  </div>
|
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <a class="code" href="classripple_1_1TERSubset.html">NotTEC</a></div>
|
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <a class="code" href="namespaceripple.html#a79aa6846cb954fb0f885aa49fd78ac4e">invalidAMMAsset</a>(</div>
|
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <a class="code" href="classripple_1_1Issue.html">Issue</a> <span class="keyword">const</span>& issue,</div>
|
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a><<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<Issue, Issue></a>> <span class="keyword">const</span>& pair = std::nullopt);</div>
|
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  </div>
|
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <a class="code" href="classripple_1_1TERSubset.html">NotTEC</a></div>
|
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <a class="code" href="namespaceripple.html#af13f4f25236f5a50bf1eeb3598a697b3">invalidAMMAssetPair</a>(</div>
|
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="classripple_1_1Issue.html">Issue</a> <span class="keyword">const</span>& issue1,</div>
|
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="classripple_1_1Issue.html">Issue</a> <span class="keyword">const</span>& issue2,</div>
|
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a><<a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair<Issue, Issue></a>> <span class="keyword">const</span>& pair = std::nullopt);</div>
|
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  </div>
|
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint8_t></a></div>
|
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <a class="code" href="namespaceripple.html#a23fcbb81cb52959dfbeebade68c4db18">ammAuctionTimeSlot</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> current, <a class="code" href="classripple_1_1STObject.html">STObject</a> <span class="keyword">const</span>& auctionSlot);</div>
|
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  </div>
|
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">bool</span></div>
|
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <a class="code" href="namespaceripple.html#a5c4fa33b0b13deab58e07744afe0f7ed">ammEnabled</a>(<a class="code" href="classripple_1_1Rules.html">Rules</a> <span class="keyword">const</span>&);</div>
|
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  </div>
|
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <span class="keyword">inline</span> <a class="code" href="classripple_1_1Number.html">Number</a></div>
|
|
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="namespaceripple.html#aa8871e2f35cee24497183274c0bab5fd"> 109</a></span> <a class="code" href="namespaceripple.html#aa8871e2f35cee24497183274c0bab5fd">getFee</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> tfee)</div>
|
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> {</div>
|
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">return</span> <a class="code" href="classripple_1_1Number.html">Number</a>{tfee} / <a class="code" href="namespaceripple.html#aed6dddd4925b3b57d0bb0a5e56e2c9f0">AUCTION_SLOT_FEE_SCALE_FACTOR</a>;</div>
|
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> }</div>
|
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  </div>
|
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="keyword">inline</span> Number</div>
|
|
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="namespaceripple.html#a7894756905fee556c1541cd1de1f697a"> 118</a></span> <a class="code" href="namespaceripple.html#a7894756905fee556c1541cd1de1f697a">feeMult</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> tfee)</div>
|
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> {</div>
|
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordflow">return</span> 1 - <a class="code" href="namespaceripple.html#aa8871e2f35cee24497183274c0bab5fd">getFee</a>(tfee);</div>
|
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> }</div>
|
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  </div>
|
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="keyword">inline</span> Number</div>
|
|
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="namespaceripple.html#ac78c8c0642bbbe33db633286fa147381"> 127</a></span> <a class="code" href="namespaceripple.html#ac78c8c0642bbbe33db633286fa147381">feeMultHalf</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> tfee)</div>
|
|
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> {</div>
|
|
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordflow">return</span> 1 - <a class="code" href="namespaceripple.html#aa8871e2f35cee24497183274c0bab5fd">getFee</a>(tfee) / 2;</div>
|
|
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> }</div>
|
|
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  </div>
|
|
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span> } <span class="comment">// namespace ripple</span></div>
|
|
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  </div>
|
|
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="preprocessor">#endif // RIPPLE_PROTOCOL_AMMCORE_H_INCLUDED</span></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<div class="ttc" id="anamespaceripple_html_aed6dddd4925b3b57d0bb0a5e56e2c9f0"><div class="ttname"><a href="namespaceripple.html#aed6dddd4925b3b57d0bb0a5e56e2c9f0">ripple::AUCTION_SLOT_FEE_SCALE_FACTOR</a></div><div class="ttdeci">constexpr std::uint32_t AUCTION_SLOT_FEE_SCALE_FACTOR</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00037">AMMCore.h:37</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Issue_html"><div class="ttname"><a href="classripple_1_1Issue.html">ripple::Issue</a></div><div class="ttdoc">A currency issued by an account.</div><div class="ttdef"><b>Definition:</b> <a href="Issue_8h_source.html#l00035">Issue.h:35</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a2e6fe99974f1e61fc7435209a335a879"><div class="ttname"><a href="namespaceripple.html#a2e6fe99974f1e61fc7435209a335a879">ripple::VOTE_MAX_SLOTS</a></div><div class="ttdeci">constexpr std::uint16_t VOTE_MAX_SLOTS</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00044">AMMCore.h:44</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a9af918dd4f383c5eef731cb372f038e6"><div class="ttname"><a href="namespaceripple.html#a9af918dd4f383c5eef731cb372f038e6">ripple::VOTE_WEIGHT_SCALE_FACTOR</a></div><div class="ttdeci">constexpr std::uint32_t VOTE_WEIGHT_SCALE_FACTOR</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00045">AMMCore.h:45</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a3227a0599e217de9084e5fc5bf55ee0c"><div class="ttname"><a href="namespaceripple.html#a3227a0599e217de9084e5fc5bf55ee0c">ripple::AUCTION_SLOT_TIME_INTERVALS</a></div><div class="ttdeci">constexpr std::uint16_t AUCTION_SLOT_TIME_INTERVALS</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00035">AMMCore.h:35</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a5e068ce58638111534101573085f71a2"><div class="ttname"><a href="namespaceripple.html#a5e068ce58638111534101573085f71a2">ripple::ammLPTIssue</a></div><div class="ttdeci">Issue ammLPTIssue(Currency const &cur1, Currency const &cur2, AccountID const &ammAccountID)</div><div class="ttdoc">Calculate LPT Issue from AMM asset pair.</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8cpp_source.html#l00056">AMMCore.cpp:56</a></div></div>
|
|
<div class="ttc" id="apair_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_abbacd2b60095e80ec98a2a5600779e48"><div class="ttname"><a href="namespaceripple.html#abbacd2b60095e80ec98a2a5600779e48">ripple::AUCTION_SLOT_DISCOUNTED_FEE_FRACTION</a></div><div class="ttdeci">constexpr std::uint32_t AUCTION_SLOT_DISCOUNTED_FEE_FRACTION</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00038">AMMCore.h:38</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a7894756905fee556c1541cd1de1f697a"><div class="ttname"><a href="namespaceripple.html#a7894756905fee556c1541cd1de1f697a">ripple::feeMult</a></div><div class="ttdeci">Number feeMult(std::uint16_t tfee)</div><div class="ttdoc">Get fee multiplier (1 - tfee) @tfee trading fee in basis points.</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00118">AMMCore.h:118</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a5c4fa33b0b13deab58e07744afe0f7ed"><div class="ttname"><a href="namespaceripple.html#a5c4fa33b0b13deab58e07744afe0f7ed">ripple::ammEnabled</a></div><div class="ttdeci">bool ammEnabled(Rules const &)</div><div class="ttdoc">Return true if required AMM amendments are enabled.</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8cpp_source.html#l00126">AMMCore.cpp:126</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_aa8871e2f35cee24497183274c0bab5fd"><div class="ttname"><a href="namespaceripple.html#aa8871e2f35cee24497183274c0bab5fd">ripple::getFee</a></div><div class="ttdeci">Number getFee(std::uint16_t tfee)</div><div class="ttdoc">Convert to the fee from the basis points.</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00109">AMMCore.h:109</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a768092086ea18d2dbeb64efb9fa12ba5"><div class="ttname"><a href="namespaceripple.html#a768092086ea18d2dbeb64efb9fa12ba5">ripple::ammAccountID</a></div><div class="ttdeci">AccountID ammAccountID(std::uint16_t prefix, uint256 const &parentHash, uint256 const &ammID)</div><div class="ttdoc">Calculate AMM account ID.</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8cpp_source.html#l00030">AMMCore.cpp:30</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_af0a4cb9a60e337bf81ea735c4bbb0bc2"><div class="ttname"><a href="namespaceripple.html#af0a4cb9a60e337bf81ea735c4bbb0bc2">ripple::invalidAMMAmount</a></div><div class="ttdeci">NotTEC invalidAMMAmount(STAmount const &amount, std::optional< std::pair< Issue, Issue >> const &pair=std::nullopt, bool validZero=false)</div><div class="ttdoc">Validate the amount.</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8cpp_source.html#l00094">AMMCore.cpp:94</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a85f9203ae884c72d6b00f9bb5e04a491"><div class="ttname"><a href="namespaceripple.html#a85f9203ae884c72d6b00f9bb5e04a491">ripple::AUCTION_SLOT_MIN_FEE_FRACTION</a></div><div class="ttdeci">constexpr std::uint32_t AUCTION_SLOT_MIN_FEE_FRACTION</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00039">AMMCore.h:39</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1base__uint_html"><div class="ttname"><a href="classripple_1_1base__uint.html">ripple::base_uint</a></div><div class="ttdoc">Integers of any length that is a multiple of 32-bits.</div><div class="ttdef"><b>Definition:</b> <a href="base__uint_8h_source.html#l00082">base_uint.h:82</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Number_html"><div class="ttname"><a href="classripple_1_1Number.html">ripple::Number</a></div><div class="ttdef"><b>Definition:</b> <a href="Number_8h_source.html#l00036">Number.h:36</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1TERSubset_html"><div class="ttname"><a href="classripple_1_1TERSubset.html">ripple::TERSubset</a></div><div class="ttdef"><b>Definition:</b> <a href="TER_8h_source.html#l00352">TER.h:352</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1STAmount_html"><div class="ttname"><a href="classripple_1_1STAmount.html">ripple::STAmount</a></div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8h_source.html#l00045">STAmount.h:45</a></div></div>
|
|
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_af13f4f25236f5a50bf1eeb3598a697b3"><div class="ttname"><a href="namespaceripple.html#af13f4f25236f5a50bf1eeb3598a697b3">ripple::invalidAMMAssetPair</a></div><div class="ttdeci">NotTEC invalidAMMAssetPair(Issue const &issue1, Issue const &issue2, std::optional< std::pair< Issue, Issue >> const &pair=std::nullopt)</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8cpp_source.html#l00079">AMMCore.cpp:79</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1STObject_html"><div class="ttname"><a href="classripple_1_1STObject.html">ripple::STObject</a></div><div class="ttdef"><b>Definition:</b> <a href="STObject_8h_source.html#l00052">STObject.h:52</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition:</b> <a href="RCLCensorshipDetector_8h_source.html#l00029">RCLCensorshipDetector.h:29</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_ad528aff4d449e3e5e4d0de8d5b2f4cf5"><div class="ttname"><a href="namespaceripple.html#ad528aff4d449e3e5e4d0de8d5b2f4cf5">ripple::TRADING_FEE_THRESHOLD</a></div><div class="ttdeci">constexpr std::uint16_t TRADING_FEE_THRESHOLD</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00031">AMMCore.h:31</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a2b3a1a7a96fd5ac1d063b50c9f6243dc"><div class="ttname"><a href="namespaceripple.html#a2b3a1a7a96fd5ac1d063b50c9f6243dc">ripple::TOTAL_TIME_SLOT_SECS</a></div><div class="ttdeci">constexpr std::uint32_t TOTAL_TIME_SLOT_SECS</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00034">AMMCore.h:34</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a358c9d5cf8201cd8d6b847f7ee6cee09"><div class="ttname"><a href="namespaceripple.html#a358c9d5cf8201cd8d6b847f7ee6cee09">ripple::AUCTION_SLOT_INTERVAL_DURATION</a></div><div class="ttdeci">constexpr std::uint32_t AUCTION_SLOT_INTERVAL_DURATION</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00040">AMMCore.h:40</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Rules_html"><div class="ttname"><a href="classripple_1_1Rules.html">ripple::Rules</a></div><div class="ttdoc">Rules controlling protocol behavior.</div><div class="ttdef"><b>Definition:</b> <a href="Rules_8h_source.html#l00033">Rules.h:33</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a79aa6846cb954fb0f885aa49fd78ac4e"><div class="ttname"><a href="namespaceripple.html#a79aa6846cb954fb0f885aa49fd78ac4e">ripple::invalidAMMAsset</a></div><div class="ttdeci">NotTEC invalidAMMAsset(Issue const &issue, std::optional< std::pair< Issue, Issue >> const &pair=std::nullopt)</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8cpp_source.html#l00065">AMMCore.cpp:65</a></div></div>
|
|
<div class="ttc" id="aoptional_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_af498a34ec9d23894e9b3f030f4dad716"><div class="ttname"><a href="namespaceripple.html#af498a34ec9d23894e9b3f030f4dad716">ripple::AUCTION_SLOT_MAX_AUTH_ACCOUNTS</a></div><div class="ttdeci">constexpr std::uint16_t AUCTION_SLOT_MAX_AUTH_ACCOUNTS</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00036">AMMCore.h:36</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a2e120e21ebcb5778e7ead49555f5297f"><div class="ttname"><a href="namespaceripple.html#a2e120e21ebcb5778e7ead49555f5297f">ripple::ammLPTCurrency</a></div><div class="ttdeci">Currency ammLPTCurrency(Currency const &cur1, Currency const &cur2)</div><div class="ttdoc">Calculate Liquidity Provider Token (LPT) Currency.</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8cpp_source.html#l00042">AMMCore.cpp:42</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_ac78c8c0642bbbe33db633286fa147381"><div class="ttname"><a href="namespaceripple.html#ac78c8c0642bbbe33db633286fa147381">ripple::feeMultHalf</a></div><div class="ttdeci">Number feeMultHalf(std::uint16_t tfee)</div><div class="ttdoc">Get fee multiplier (1 - tfee / 2) @tfee trading fee in basis points.</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8h_source.html#l00127">AMMCore.h:127</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a23fcbb81cb52959dfbeebade68c4db18"><div class="ttname"><a href="namespaceripple.html#a23fcbb81cb52959dfbeebade68c4db18">ripple::ammAuctionTimeSlot</a></div><div class="ttdeci">std::optional< std::uint8_t > ammAuctionTimeSlot(std::uint64_t current, STObject const &auctionSlot)</div><div class="ttdoc">Get time slot of the auction slot.</div><div class="ttdef"><b>Definition:</b> <a href="AMMCore_8cpp_source.html#l00107">AMMCore.cpp:107</a></div></div>
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|