mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-02 08:55:53 +00:00
deploy: 3b191a3097
This commit is contained in:
@@ -242,7 +242,7 @@ Static Private Member Functions</h2></td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p><a class="el" href="classripple_1_1AMMCreate.html" title="AMMCreate implements Automatic Market Maker(AMM) creation Transactor.">AMMCreate</a> implements Automatic Market Maker(AMM) creation <a class="el" href="classripple_1_1Transactor.html">Transactor</a>. </p>
|
||||
<p>It creates a new AMM instance with two tokens. Any trader, or Liquidity Provider (LP), can create the AMM instance and receive in return shares of the AMM pool in the form on LPTokens. The number of tokens that LP gets are determined by LPTokens = sqrt(A * B), where A and B is the current composition of the AMM pool. LP can add (<a class="el" href="classripple_1_1AMMDeposit.html" title="AMMDeposit implements AMM deposit Transactor.">AMMDeposit</a>) or withdraw (<a class="el" href="classripple_1_1AMMWithdraw.html" title="AMMWithdraw implements AMM withdraw Transactor.">AMMWithdraw</a>) tokens from AMM and AMM can be used transparently in the payment or offer crossing transactions. Trading fee is charged to the traders for the trades executed against AMM instance. The fee is added to the AMM pool and distributed to the LPs in proportion to the LPTokens upon liquidity removal. The fee can be voted on by LP's (<a class="el" href="classripple_1_1AMMVote.html" title="AMMVote implements AMM vote Transactor.">AMMVote</a>). LP's can continuously bid (<a class="el" href="classripple_1_1AMMBid.html" title="AMMBid implements AMM bid Transactor.">AMMBid</a>) for the 24 hour auction slot, which enables LP's to trade at zero trading fee. AMM instance creates AccountRoot object with disabled master key for book-keeping of XRP balance if one of the tokens is XRP, a trustline for each IOU token, a trustline to keep track of LPTokens, and ltAMM ledger object. AccountRoot ID is generated internally from the parent's hash. ltAMM's object ID is hash{token1.currency, token1.issuer, token2.currency, token2.issuer}, where issue1 < issue2. ltAMM object provides mapping from the hash to AccountRoot ID and contains: AMMAccount - AMM AccountRoot ID. TradingFee - AMM voted TradingFee. VoteSlots - Array of VoteEntry, contains fee vote information. AuctionSlot - Auction slot, contains discounted fee bid information. LPTokenBalance - LPTokens outstanding balance. AMMToken - currency/issuer information for AMM tokens. <a class="el" href="classripple_1_1AMMDeposit.html" title="AMMDeposit implements AMM deposit Transactor.">AMMDeposit</a>, <a class="el" href="classripple_1_1AMMWithdraw.html" title="AMMWithdraw implements AMM withdraw Transactor.">AMMWithdraw</a>, <a class="el" href="classripple_1_1AMMVote.html" title="AMMVote implements AMM vote Transactor.">AMMVote</a>, and <a class="el" href="classripple_1_1AMMBid.html" title="AMMBid implements AMM bid Transactor.">AMMBid</a> transactions use the hash to access AMM instance. </p><dl class="section see"><dt>See also</dt><dd><a href="https://github.com/XRPLF/XRPL-Standards/discussions/78">XLS30d:Creating AMM instance on XRPL</a> </dd></dl>
|
||||
<p>It creates a new AMM instance with two tokens. Any trader, or Liquidity Provider (LP), can create the AMM instance and receive in return shares of the AMM pool in the form of LPTokens. The number of tokens that LP gets are determined by LPTokens = sqrt(A * B), where A and B is the current composition of the AMM pool. LP can add (<a class="el" href="classripple_1_1AMMDeposit.html" title="AMMDeposit implements AMM deposit Transactor.">AMMDeposit</a>) or withdraw (<a class="el" href="classripple_1_1AMMWithdraw.html" title="AMMWithdraw implements AMM withdraw Transactor.">AMMWithdraw</a>) tokens from AMM and AMM can be used transparently in the payment or offer crossing transactions. Trading fee is charged to the traders for the trades executed against AMM instance. The fee is added to the AMM pool and distributed to the LPs in proportion to the LPTokens upon liquidity removal. The fee can be voted on by LP's (<a class="el" href="classripple_1_1AMMVote.html" title="AMMVote implements AMM vote Transactor.">AMMVote</a>). LP's can continuously bid (<a class="el" href="classripple_1_1AMMBid.html" title="AMMBid implements AMM bid Transactor.">AMMBid</a>) for the 24 hour auction slot, which enables LP's to trade at zero trading fee. AMM instance creates AccountRoot object with disabled master key for book-keeping of XRP balance if one of the tokens is XRP, a trustline for each IOU token, a trustline to keep track of LPTokens, and ltAMM ledger object. AccountRoot ID is generated internally from the parent's hash. ltAMM's object ID is hash{token1.currency, token1.issuer, token2.currency, token2.issuer}, where issue1 < issue2. ltAMM object provides mapping from the hash to AccountRoot ID and contains: AMMAccount - AMM AccountRoot ID. TradingFee - AMM voted TradingFee. VoteSlots - Array of VoteEntry, contains fee vote information. AuctionSlot - Auction slot, contains discounted fee bid information. LPTokenBalance - LPTokens outstanding balance. AMMToken - currency/issuer information for AMM tokens. <a class="el" href="classripple_1_1AMMDeposit.html" title="AMMDeposit implements AMM deposit Transactor.">AMMDeposit</a>, <a class="el" href="classripple_1_1AMMWithdraw.html" title="AMMWithdraw implements AMM withdraw Transactor.">AMMWithdraw</a>, <a class="el" href="classripple_1_1AMMVote.html" title="AMMVote implements AMM vote Transactor.">AMMVote</a>, and <a class="el" href="classripple_1_1AMMBid.html" title="AMMBid implements AMM bid Transactor.">AMMBid</a> transactions use the hash to access AMM instance. </p><dl class="section see"><dt>See also</dt><dd><a href="https://github.com/XRPLF/XRPL-Standards/discussions/78">XLS30d:Creating AMM instance on XRPL</a> </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="AMMCreate_8h_source.html#l00057">57</a> of file <a class="el" href="AMMCreate_8h_source.html">AMMCreate.h</a>.</p>
|
||||
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
||||
|
||||
Reference in New Issue
Block a user