AMMCreate class
Create a new Automated Market Maker (AMM) instance for trading a pair of assets (fungible tokens or XRP).
Creates both an AMM object and a special AccountRoot object 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.
- Inheritance
-
- Object
- XRPLBase
- XRPTransaction
- AMMCreate
Constructors
-
AMMCreate.new({required String account, required CurrencyAmount amount, required CurrencyAmount amount2, required int tradingFee, List<
XRPLMemo> ? memos = const [], String signingPubKey = "", int? ticketSequance, BigInt? fee, int? lastLedgerSequence, int? sequence, List<XRPLSigners> ? signers, dynamic flags, int? sourceTag, List<String> multiSigSigners = const []}) -
AMMCreate.fromJson(Map<
String, dynamic> json)
Properties
- account → String
-
finalinherited
- accountTxId → String?
-
finalinherited
- amount → CurrencyAmount
-
amount The first of the two assets to fund this AMM with. This must be a positive amount
final
- amount2 → CurrencyAmount
-
amount2 The second of the two assets to fund this AMM with. This must be a positive amount.
final
- fee ↔ BigInt?
-
getter/setter pairinherited
- flags → dynamic
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastLedgerSequence ↔ int?
-
getter/setter pairinherited
-
memos
↔ List<
XRPLMemo> ? -
getter/setter pairinherited
-
multiSigSigners
↔ List<
String> -
getter/setter pairinherited
- networkId ↔ int?
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sequence ↔ int?
-
getter/setter pairinherited
-
signers
↔ List<
XRPLSigners> ? -
getter/setter pairinherited
- signingPubKey ↔ String
-
getter/setter pairinherited
- sourceTag → int?
-
finalinherited
- ticketSequance → int?
-
finalinherited
- tradingFee → int
-
tradingFee The 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.
final
- transactionType → XRPLTransactionType
-
finalinherited
- txnSignature ↔ String?
-
getter/setter pairinherited
- validate → String?
-
no setteroverride
Methods
-
getHash(
) → String -
inherited
-
isSigned(
) → bool -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setFee(
BigInt? newFee) → void -
inherited
-
setLastLedgerSequence(
int? newSequance) → void -
inherited
-
setMultiSigSignature(
List< XRPLSigners> sigs) → void -
inherited
-
setNetworkId(
int? network) → void -
inherited
-
setSequence(
int? newSequance) → void -
inherited
-
setSignature(
String? sig) → void -
inherited
-
toBlob(
{bool forSigning = true}) → String -
inherited
-
toJson(
) → Map< String, dynamic> -
Converts the object to a JSON representation.
override
-
toMultisigBlob(
String address) → String -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toXrpl(
) → Map< String, dynamic> -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- ammMaxTradingFee → const int