AMMCreate (2024)

Last updated

Edit

[Source]

(Added by the AMM amendment)

Create a new Automated Market Maker (AMM) instance for trading a pair of assets (fungible tokens or XRP).

Creates both an AMM entry and a special AccountRoot entry to represent the AMM. Also transfers ownership of the starting balance of both assets from the sender to the created AccountRoot and issues an initial balance of liquidity provider tokens (LP Tokens) from the AMM account to the sender.

Caution: When you create the AMM, you should fund it with (approximately) equal-value amounts of each asset. Otherwise, other users can profit at your expense by trading with this AMM (performing arbitrage). The currency risk that liquidity providers take on increases with the volatility (potential for imbalance) of the asset pair. The higher the trading fee, the more it offsets this risk, so it's best to set the trading fee based on the volatility of the asset pair.

Example AMMCreate JSON

{ "Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm", "Amount" : { "currency" : "TST", "issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd", "value" : "25" }, "Amount2" : "250000000", "Fee" : "2000000", "Flags" : 2147483648, "Sequence" : 6, "TradingFee" : 500, "TransactionType" : "AMMCreate"}

AMMCreate Fields

In addition to the common fields, AMMCreate transactions use the following fields:

FieldJSON TypeInternal TypeRequired?Description
AmountCurrency AmountAmountYesThe first of the two assets to fund this AMM with. This must be a positive amount.
Amount2Currency AmountAmountYesThe second of the two assets to fund this AMM with. This must be a positive amount.
TradingFeeNumberUInt16YesThe fee to charge for trades against this AMM instance, in units of 1/100,000; a value of 1 is equivalent to 0.001%. The maximum value is 1000, indicating a 1% fee. The minimum value is 0.

One or both of Amount and Amount2 can be tokens; at most one of them can be XRP. They cannot both have the same currency code and issuer. The tokens' issuers must have Default Ripple enabled. If the Clawback amendment is enabled, those issuers must not have enabled the Allow Clawback flag. The assets cannot be LP tokens for another AMM.

Special Transaction Cost

Since each AMM instance involves an AccountRoot ledger entry, an AMM ledger entry, and a trust line for each token in its pool, an AMMCreate transaction requires a much higher than usual transaction cost to deter ledger spam. Instead of the standard minimum of 0.00001 XRP, AMMCreate must destroy at least the incremental owner reserve amount, currently 2 XRP. This is the same special transaction cost as AccountDelete transactions.

Error Cases

Besides errors that can occur for all transactions, AMMCreate transactions can result in the following transaction result codes:

Error CodeDescription
tecAMM_INVALID_TOKENSEither Amount or Amount2 has a currency code that is the same as this AMM's LP Tokens would use. (This is very unlikely to occur.)
tecDUPLICATEThere is already another AMM for this currency pair.
tecFROZENAt least one of the deposit assets (Amount or Amount2) is currently frozen.
tecINSUF_RESERVE_LINEThe sender of this transaction does meet the increased reserve requirement of processing this transaction, probably because they need a new trust line to hold the LP Tokens, and they don't have enough XRP to meet the additional owner reserve for a new trust line.
tecNO_AUTHAt least one of the deposit assets uses authorized trust lines and the sender does not have authorization to hold that asset.
tecNO_LINEThe sender does not have a trust line for at least one of the deposit assets.
tecNO_PERMISSIONAt least one of the deposit assets cannot be used in an AMM. For example, the issuer has enabled Clawback support.
tecUNFUNDED_AMMThe sender does not hold enough of the assets specified in Amount and Amount2 to fund the AMM.
terNO_RIPPLEThe issuer of at least one of the assets has not enabled the Default Ripple flag.
temAMM_BAD_TOKENSThe values of Amount and Amount2 are not valid: for example, both refer to the same token.
temBAD_FEEThe TradingFee value is invalid. It must be zero or a positive integer and cannot be over 1000.
temDISABLEDThe AMM feature is not enabled on this network.

Previous page

Next page

AMMCreate (2024)
Top Articles
What is Airbnb up to in 2024? Strategy analyzed + Bold predictions
NASA's FY 2024 Budget
St Thomas Usvi Craigslist
Www.1Tamilmv.cafe
How Many Cc's Is A 96 Cubic Inch Engine
Exam With A Social Studies Section Crossword
Chase Bank Operating Hours
DENVER Überwachungskamera IOC-221, IP, WLAN, außen | 580950
2013 Chevy Cruze Coolant Hose Diagram
A.e.a.o.n.m.s
Orlando Arrest and Public Records | Florida.StateRecords.org
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis - NFL
Craigslist Mpls Cars And Trucks
Bend Pets Craigslist
Mzinchaleft
Exterior insulation details for a laminated timber gothic arch cabin - GreenBuildingAdvisor
Beverage Lyons Funeral Home Obituaries
Why do rebates take so long to process?
Ice Dodo Unblocked 76
Del Amo Fashion Center Map
Directions To Nearest T Mobile Store
Sofia the baddie dog
2011 Hyundai Sonata 2 4 Serpentine Belt Diagram
Danielle Moodie-Mills Net Worth
HP PARTSURFER - spare part search portal
Www Mydocbill Rada
Publix Coral Way And 147
Willys Pickup For Sale Craigslist
Flixtor Nu Not Working
Song That Goes Yeah Yeah Yeah Yeah Sounds Like Mgmt
Chs.mywork
KITCHENAID Tilt-Head Stand Mixer Set 4.8L (Blue) + Balmuda The Pot (White) 5KSM175PSEIC | 31.33% Off | Central Online
Claim loopt uit op pr-drama voor Hohenzollern
Dying Light Nexus
Hindilinks4U Bollywood Action Movies
Chatropolis Call Me
Skip The Games Grand Rapids Mi
Tryst Houston Tx
Craigslist Florida Trucks
Ferguson Showroom West Chester Pa
Giovanna Ewbank Nua
Rocky Bfb Asset
Best Suv In 2010
How to Connect Jabra Earbuds to an iPhone | Decortweaks
bot .com Project by super soph
Minterns German Shepherds
Pas Bcbs Prefix
6463896344
25100 N 104Th Way
Rétrospective 2023 : une année culturelle de renaissances et de mutations
Att Corporate Store Location
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 6657

Rating: 4 / 5 (51 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.