mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 11:55:50 +00:00
Merge pull request #1541 from XRPLF/amm_ref
Automated Market Maker (XLS-30d) reference documentation
This commit is contained in:
File diff suppressed because one or more lines are too long
129
content/_img-sources/amm-single-asset-deposit-formula.uxf
Normal file
129
content/_img-sources/amm-single-asset-deposit-formula.uxf
Normal file
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<diagram program="umlet" version="14.2">
|
||||
<zoom_level>10</zoom_level>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>90</x>
|
||||
<y>150</y>
|
||||
<w>70</w>
|
||||
<h>30</h>
|
||||
</coordinates>
|
||||
<panel_attributes>L = T ×</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>190</x>
|
||||
<y>150</y>
|
||||
<w>180</w>
|
||||
<h>30</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=-</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;160.0;10.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>370</x>
|
||||
<y>150</y>
|
||||
<w>30</w>
|
||||
<h>30</h>
|
||||
</coordinates>
|
||||
<panel_attributes>- 1</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>350</x>
|
||||
<y>130</y>
|
||||
<w>30</w>
|
||||
<h>30</h>
|
||||
</coordinates>
|
||||
<panel_attributes>W</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>160</x>
|
||||
<y>130</y>
|
||||
<w>40</w>
|
||||
<h>50</h>
|
||||
</coordinates>
|
||||
<panel_attributes>fontsize=40
|
||||
(</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>340</x>
|
||||
<y>130</y>
|
||||
<w>40</w>
|
||||
<h>50</h>
|
||||
</coordinates>
|
||||
<panel_attributes>fontsize=40
|
||||
)</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>150</x>
|
||||
<y>120</y>
|
||||
<w>40</w>
|
||||
<h>70</h>
|
||||
</coordinates>
|
||||
<panel_attributes>fontsize=60
|
||||
[</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>390</x>
|
||||
<y>120</y>
|
||||
<w>40</w>
|
||||
<h>80</h>
|
||||
</coordinates>
|
||||
<panel_attributes>fontsize=60
|
||||
]</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>260</x>
|
||||
<y>160</y>
|
||||
<w>30</w>
|
||||
<h>30</h>
|
||||
</coordinates>
|
||||
<panel_attributes>P</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>200</x>
|
||||
<y>140</y>
|
||||
<w>160</w>
|
||||
<h>20</h>
|
||||
</coordinates>
|
||||
<panel_attributes>B - (F × (1 - W) × B)</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Text</id>
|
||||
<coordinates>
|
||||
<x>170</x>
|
||||
<y>150</y>
|
||||
<w>40</w>
|
||||
<h>30</h>
|
||||
</coordinates>
|
||||
<panel_attributes>1 +</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
</diagram>
|
||||
1
content/_snippets/amm-disclaimer.md
Normal file
1
content/_snippets/amm-disclaimer.md
Normal file
@@ -0,0 +1 @@
|
||||
_Automated Market Maker (AMM) functionality is part of the proposed [XLS-30d](https://github.com/XRPLF/XRPL-Standards/discussions/78) extension :not_enabled: to the XRP Ledger protocol. You can use these functions on AMM test networks, but there isn't an official amendment and they aren't available on the production Mainnet. Until there is an amendment, the details documented on these pages are subject to change._
|
||||
@@ -1,3 +1,3 @@
|
||||
## {{currentpage.name}} Fields
|
||||
|
||||
In addition to the [common fields](pseudo-transaction-types.html), a {{currentpage.name}} pseudo-transaction uses the following fields:
|
||||
In addition to the [common fields](pseudo-transaction-types.html), {{currentpage.name}} pseudo-transactions use the following fields:
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
{% set ledger_entries = [
|
||||
"AccountRoot",
|
||||
"Amendments",
|
||||
"AMM",
|
||||
"Check",
|
||||
"DepositPreauth",
|
||||
"DirectoryNode",
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
## {{currentpage.name}} Fields
|
||||
|
||||
In addition to the [common fields][], a {{currentpage.name}} transaction uses the following fields:
|
||||
In addition to the [common fields][], {{currentpage.name}} transactions use the following fields:
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{% set txtypes = [
|
||||
"AccountDelete",
|
||||
"AccountSet",
|
||||
"AMMBid",
|
||||
"AMMDeposit",
|
||||
"AMMCreate",
|
||||
"AMMVote",
|
||||
"AMMWithdraw",
|
||||
"CheckCancel",
|
||||
"CheckCash",
|
||||
"CheckCreate",
|
||||
|
||||
@@ -31,6 +31,59 @@ XRP Ledgerは完全にオープンな共有グローバルレジャーです。
|
||||
|
||||
トランザクションの場合、識別用ハッシュは署名済みトランザクションの指示に基づいていますが、検索時のトランザクションオブジェクトにはトランザクションの結果とメタデータが含まれています。これは、ハッシュの生成時には反映されません。
|
||||
|
||||
<!-- TODO: translate these new sections -->
|
||||
|
||||
## Open, Closed, and Validated Ledgers
|
||||
|
||||
The `rippled` server makes a distinction between ledger versions that are _open_, _closed_, and _validated_. A server has one open ledger, any number of closed but unvalidated ledgers, and an immutable history of validated ledgers. The following table summarizes the difference:
|
||||
|
||||
| Ledger Type: | Open | Closed | Validated |
|
||||
|:---------------------------------|:----------------------------|:-------------------------------------------|:--|
|
||||
| **Purpose:** | Temporary workspace | Proposed next state | Confirmed previous state |
|
||||
| **Number used:** | 1 | Any number, but usually 0 or 1 | One per ledger index, growing over time |
|
||||
| **Can contents change?** | Yes | No, but the whole ledger could be replaced | Never |
|
||||
| **Transactions are applied in:** | The order they are received | Canonical order | Canonical order |
|
||||
|
||||
Unintuitively, the XRP Ledger never "closes" an open ledger to convert it into a closed ledger. Instead, the server throws away the open ledger, creates a new closed ledger by applying transactions on top of a previous closed ledger, then creates a new open ledger using the latest closed ledger as a base. This is a consequence of [how consensus solves the double-spend problem](consensus-principles-and-rules.html#問題の単純化).
|
||||
|
||||
For an open ledger, servers apply transactions in the order those transactions appear, but different servers may see transactions in different orders. Since there is no central timekeeper to decide which transaction was actually first, servers may disagree on the exact order of transactions that were sent around the same time. Thus, the process for calculating a closed ledger version that is eligible for [validation](consensus.html#検証) is different than the process of building an open ledger from proposed transactions in the order they arrive. To create a "closed" ledger, each XRP Ledger server starts with a set of transactions and a previous, or "parent", ledger version. The server puts the transactions in a canonical order, then applies them to the previous ledger in that order. The canonical order is designed to be deterministic and efficient, but hard to game, to increase the difficulty of front-running Offers in the [decentralized exchange](decentralized-exchange.html).
|
||||
|
||||
Thus, an open ledger is only ever used as a temporary workspace, which is a major reason why transactions' [tentative results may vary from their final results](finality-of-results.html).
|
||||
|
||||
## Ledger Close Times
|
||||
|
||||
The time that a ledger version closed is recorded at the `close_time` field of the [ledger header](ledger-header.html). To make it easier for the network to reach a consensus on an exact close time, this value is rounded to a number of seconds based on the close time resolution, currently 10 seconds. If rounding would cause a ledger's close time to be the same as (or earlier than) its parent ledger's, the child ledger has its close time set to the parent's close time plus 1. This guarantees that the close times of validated ledgers are strictly increasing. <!-- STYLE_OVERRIDE: a number of -->
|
||||
|
||||
Since new ledger versions usually close about every 3 to 5 seconds, these rules result in a loose pattern where ledgers' close times end in :00, :01, :02, :10, :11, :20, :21, and so on. Times ending in 2 are less common and times ending in 3 are very rare, but both occur randomly when more ledgers randomly happen to close within a 10-second window.
|
||||
|
||||
Generally speaking, the ledger cannot make any time-based measurements that are more precise than the close time resolution. For example, to check if an object has passed an expiration date, the rule is to compare it to the close time of the parent ledger. (The close time of a ledger is not yet known when executing transactions to go into that ledger.) This means that, for example, an [Escrow](escrow.html) could successfully finish at a real-world time that is up to about 10 seconds later than the time-based expiration specified in the Escrow object.
|
||||
|
||||
### Example
|
||||
|
||||
The following examples demonstrate the rounding behavior of ledger close times, from the perspective of an example validator, following a ledger with the close time **12:00:00**:
|
||||
|
||||
**Current consensus round**
|
||||
|
||||
1. A validator notes that it was **12:00:03** when the ledger closed and entered consensus. The validator includes this close time in its proposals.
|
||||
2. The validator observes that most other validators (on its UNL) proposed a close time of 12:00:02, and one other proposed a close time of 12:00:03. It changes its proposed close time to match the consensus of **12:00:02**.
|
||||
3. The validator rounds this value to the nearest close time interval, resulting in **12:00:00**.
|
||||
4. Since 12:00:00 is not greater than the previous ledger's close time, the validator adjusts the close time to be exactly 1 second after the previous ledger's close time. The result is an adjusted close time of **12:00:01**.
|
||||
5. The validator builds the ledger with these details, calculates the resulting hash, and confirms in the [validation step](consensus.html#検証) that others did the same.
|
||||
|
||||
Non-validating servers do all the same steps, except they don't propose their recorded close times to the rest of the network.
|
||||
|
||||
**Next consensus round**
|
||||
|
||||
1. The next ledger enters consensus at **12:00:04** according to most validators.
|
||||
2. This rounds down again, to a close time of **12:00:00**.
|
||||
3. Since this is not greater than the previous ledger's close time of 12:00:01, the adjusted close time is **12:00:02**.
|
||||
|
||||
**Next consensus round after that**
|
||||
|
||||
1. The ledger after that enters consensus at **12:00:05** according to most validators.
|
||||
2. This rounds up, based on the close time resolution, to **12:00:10**.
|
||||
3. Since this value is larger than the previous ledger's close time, it does not need to be adjusted. **12:00:10** becomes the official close time.
|
||||
|
||||
|
||||
## 関連項目
|
||||
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
---
|
||||
html: amm_info.html
|
||||
parent: path-and-order-book-methods.html
|
||||
blurb: Get info about an Automted Market Maker (AMM) instance.
|
||||
status: not_enabled
|
||||
labels:
|
||||
- Decentralized Exchange
|
||||
- Cross-Currency
|
||||
- AMM
|
||||
---
|
||||
# amm_info
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/rpc/handlers/AMMInfo.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
The `{{currentpage.name}}` method gets information about an Automated Market Maker (AMM) instance.
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
|
||||
### Request Format
|
||||
|
||||
An example of the request format:
|
||||
|
||||
{% include '_snippets/no-cli-syntax.md' %}
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "{{currentpage.name}}",
|
||||
"asset": {
|
||||
"currency": "XRP"
|
||||
},
|
||||
"asset2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "{{currentpage.name}}",
|
||||
"params": [{
|
||||
"asset": {
|
||||
"currency": "XRP"
|
||||
},
|
||||
"asset2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
}
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
The request includes the following parameters:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------|:-----------------|:-----------------------------------|
|
||||
| `asset` | Object or String | One of the assets of the AMM to look up, as an object with `currency` and `issuer` fields (omit `issuer` for XRP), like [currency amounts][Currency Amount]. For XRP, you can specify as the string `XRP` instead of as an object. |
|
||||
| `asset2` | Object or String | The other of the assets of the AMM, as an object with `currency` and `issuer` fields (omit `issuer` for XRP), like [currency amounts][Currency Amount]. |
|
||||
|
||||
|
||||
### Response Format
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"result": {
|
||||
"amm": {
|
||||
"AMMAccount" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"AuctionSlot" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"AuthAccounts" : [
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv"
|
||||
}
|
||||
}
|
||||
],
|
||||
"DiscountedFee" : 0,
|
||||
"Expiration" : 721870180,
|
||||
"Price" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "0.8696263565463045"
|
||||
}
|
||||
},
|
||||
"Flags" : 0,
|
||||
"LPTokenBalance" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "71150.53584131501"
|
||||
},
|
||||
"TradingFee" : 600,
|
||||
"VoteSlots" : [
|
||||
{
|
||||
"VoteEntry" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"TradingFee" : 600,
|
||||
"VoteWeight" : 100000
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"ledger_current_index": 226645,
|
||||
"validated": false
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"amm": {
|
||||
"AMMAccount" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"AuctionSlot" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"AuthAccounts" : [
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv"
|
||||
}
|
||||
}
|
||||
],
|
||||
"DiscountedFee" : 0,
|
||||
"Expiration" : 721870180,
|
||||
"Price" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "0.8696263565463045"
|
||||
}
|
||||
},
|
||||
"Flags" : 0,
|
||||
"LPTokenBalance" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "71150.53584131501"
|
||||
},
|
||||
"TradingFee" : 600,
|
||||
"VoteSlots" : [
|
||||
{
|
||||
"VoteEntry" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"TradingFee" : 600,
|
||||
"VoteWeight" : 100000
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"ledger_current_index": 226620,
|
||||
"status": "success",
|
||||
"validated": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:-----------------------|:--------|:----------------------------------------------------------|
|
||||
| `amm` | Object | The [AMM object](amm.html) for the requested asset pair. |
|
||||
| `ledger_current_index` | Integer | _(Omitted if `ledger_index` is provided instead)_ The [ledger index][] of the current in-progress ledger, which was used when retrieving this information. |
|
||||
| `ledger_index` | Integer | _(Omitted if `ledger_current_index` is provided instead)_ The [ledger index][] of the ledger version used when retrieving this information. |
|
||||
| `validated` | Boolean | If `true`, the ledger used for this request is validated and these results are final; if omitted or set to `false`, the data is pending and may change. |
|
||||
|
||||
|
||||
|
||||
### Possible Errors
|
||||
|
||||
- Any of the [universal error types][].
|
||||
- `actNotFound` - The AMM for this asset pair does not exist, or an issuing account specified in the request does not exist.
|
||||
- `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -55,8 +55,11 @@ XRP Ledgerのアカウントとは、XRPの保有者と取引の送信者を意
|
||||
|
||||
パスは、支払いが送信者から受信者に届くまでに中間ステップでたどる道筋を定義します。パスは、送信者と受信者をオーダーブックを介してつなぐことで、複数通貨間の支払いを可能にします。パスと他のオーダーブックに関しては、以下のメソッドを使用します。
|
||||
|
||||
* **[`amm_info`](amm_info.html)** :not_enabled: - 自動マーケットメイカー(AMM)についての情報を取得します。
|
||||
* **[`book_offers`](book_offers.html)** - 2つの通貨を交換するオファーに関する情報を取得します。
|
||||
* **[`deposit_authorized`](deposit_authorized.html)** - あるアカウントが別のアカウントへの支払いの直接送信について承認されているかどうかを調べます。
|
||||
* **[`nft_buy_offers`](nft_buy_offers.html)** - Retrieve a list of buy offers for a specified NFToken object.
|
||||
* **[`nft_sell_offers`](nft_sell_offers.html)** - Retrieve a list of sell offers for a specified NFToken object.
|
||||
* **[`path_find`](path_find.html)** - 2つのアカウント間の支払いのパスを見つけて、更新を受け取ります。
|
||||
* **[`ripple_path_find`](ripple_path_find.html)** - 2つのアカウント間の支払いのパスを1回だけ見つけます。
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ By default, the following methods are [admin-only](admin-api-methods.html). They
|
||||
|
||||
Paths define a way for payments to flow through intermediary steps on their way from sender to receiver. Paths enable cross-currency payments by connecting sender and receiver through order books. Use these methods to work with paths and other books.
|
||||
|
||||
* **[`amm_info`](amm_info.html)** :not_enabled: - Get info about an Automated Market Maker (AMM).
|
||||
* **[`book_offers`](book_offers.html)** - Get info about offers to exchange two currencies.
|
||||
* **[`deposit_authorized`](deposit_authorized.html)** - Look up whether one account is authorized to send payments directly to another.
|
||||
* **[`nft_buy_offers`](nft_buy_offers.html)** - Retrieve a list of buy offers for a specified NFToken object.
|
||||
|
||||
@@ -56,6 +56,22 @@ labels:
|
||||
| `WalletLocator` | 文字列 | Hash256 | _(省略可)_ **廃止予定**。使用しないでください。 |
|
||||
| `WalletSize` | 数値 | UInt32 | _(省略可)_ **廃止予定**。使用しないでください。 |
|
||||
|
||||
## Special AMM AccountRoot Objects
|
||||
<!-- TODO: translate this section -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Automated Market Makers (AMMs) use an AccountRoot object to issue their LP Tokens and hold the assets in the AMM pool, in addition to the [AMM object][] for tracking some of the details of the AMM. The address of an AMM's associated AccountRoot is randomized so that users cannot identify and fund the address in advance of the AMM being created. Unlike normal accounts, AMM AccountRoots are created with the following settings:
|
||||
|
||||
- `lsfAMM` **enabled**. This indicates that the AccountRoot is part of an AMM and is not a regular account.
|
||||
- `lsfDisableMaster` **enabled** and no other means of authorizing transactions. This ensures no one can control the account directly, and it cannot send transactions.
|
||||
- `lsfRequireAuth` **enabled** and no accounts preauthorized. This ensures that the only way to add money to the AMM Account is using the [AMMDeposit transaction][].
|
||||
- `lsfDefaultRipple` **enabled**. This ensures that users can send and trade the AMM's LP Tokens among themselves.
|
||||
|
||||
These special accounts are not subject to the [reserve requirement](reserves.html) but they can hold XRP if it is one of the two assets in the AMM's pool.
|
||||
|
||||
In most other ways, these accounts function like ordinary accounts; the LP Tokens they issue behave like other [tokens](tokens.html) except that those tokens can also be used in AMM-related transactions. You can check an AMM's balances and the history of transactions that affected it the same way you would with a regular account.
|
||||
|
||||
## AccountRootのフラグ
|
||||
|
||||
このアカウントに対して有効化または無効化できる各種オプションがあります。これらのオプションを変更するには、[AccountSetトランザクション][]を使用します。レジャーではフラグはバイナリ値として表され、これらのバイナリ値はビットOR演算と組み合わせることができます。レジャーでのフラグのビット値は、トランザクションでこれらのフラグを有効または無効にするために使用する値とは異なります。レジャーのフラグには、 _lsf_ で始まる名前が付いています。
|
||||
|
||||
@@ -57,8 +57,9 @@ The `AccountRoot` object has the following fields:
|
||||
| `TicketCount` | Number | UInt32 | No | How many [Tickets](tickets.html) this account owns in the ledger. This is updated automatically to ensure that the account stays within the hard limit of 250 Tickets at a time. This field is omitted if the account has zero Tickets. _(Added by the [TicketBatch amendment][].)_ |
|
||||
| `TickSize` | Number | UInt8 | No | How many significant digits to use for exchange rates of Offers involving currencies issued by this address. Valid values are `3` to `15`, inclusive. _(Added by the [TickSize amendment][].)_ |
|
||||
| `TransferRate` | Number | UInt32 | No | A [transfer fee](transfer-fees.html) to charge other users for sending currency issued by this account to each other. |
|
||||
| `WalletLocator` | String | Hash256 | No | **DEPRECATED**. Do not use. |
|
||||
| `WalletSize` | Number | UInt32 | No | **DEPRECATED**. Do not use. |
|
||||
| `WalletLocator` | String | Hash256 | No | An arbitrary 256-bit value that users can set. |
|
||||
| `WalletSize` | Number | UInt32 | No | Unused. (The code supports this field but there is no way to set it.) |
|
||||
|
||||
|
||||
## AccountRoot Flags
|
||||
|
||||
@@ -68,6 +69,7 @@ AccountRoot objects can have the following flag values:
|
||||
|
||||
| Flag Name | Hex Value | Decimal Value | Corresponding [AccountSet Flag](accountset.html#accountset-flags) | Description |
|
||||
|---------------------|--------------|---------------|--------------------|----|
|
||||
| `lsfAMM` :not_enabled: | `0x02000000` | 33554432 | (None) | This account is an Automated Market Maker instance. :not_enabled: |
|
||||
| `lsfDefaultRipple` | `0x00800000` | 8388608 | `asfDefaultRipple` | Enable [rippling](rippling.html) on this addresses's trust lines by default. Required for issuing addresses; discouraged for others. |
|
||||
| `lsfDepositAuth` | `0x01000000` | 16777216 | `asfDepositAuth` | This account can only receive funds from transactions it sends, and from [preauthorized](depositauth.html#preauthorization) accounts. (It has [DepositAuth](depositauth.html) enabled.) |
|
||||
| `lsfDisableMaster` | `0x00100000` | 1048576 | `asfDisableMaster` | Disallows use of the master key to sign transactions for this account. |
|
||||
@@ -78,6 +80,23 @@ AccountRoot objects can have the following flag values:
|
||||
| `lsfRequireAuth` | `0x00040000` | 262144 | `asfRequireAuth` | This account must individually approve other users for those users to hold this account's tokens. |
|
||||
| `lsfRequireDestTag` | `0x00020000` | 131072 | `asfRequireDest` | Requires incoming payments to specify a Destination Tag. |
|
||||
|
||||
|
||||
## Special AMM AccountRoot Objects
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Automated Market Makers (AMMs) use an AccountRoot object to issue their LP Tokens and hold the assets in the AMM pool, in addition to the [AMM object][] for tracking some of the details of the AMM. The address of an AMM's associated AccountRoot is randomized so that users cannot identify and fund the address in advance of the AMM being created. Unlike normal accounts, AMM AccountRoots are created with the following settings:
|
||||
|
||||
- `lsfAMM` **enabled**. This indicates that the AccountRoot is part of an AMM and is not a regular account.
|
||||
- `lsfDisableMaster` **enabled** and no other means of authorizing transactions. This ensures no one can control the account directly, and it cannot send transactions.
|
||||
- `lsfRequireAuth` **enabled** and no accounts preauthorized. This ensures that the only way to add money to the AMM Account is using the [AMMDeposit transaction][].
|
||||
- `lsfDefaultRipple` **enabled**. This ensures that users can send and trade the AMM's LP Tokens among themselves.
|
||||
|
||||
These special accounts are not subject to the [reserve requirement](reserves.html) but they can hold XRP if it is one of the two assets in the AMM's pool.
|
||||
|
||||
In most other ways, these accounts function like ordinary accounts; the LP Tokens they issue behave like other [tokens](tokens.html) except that those tokens can also be used in AMM-related transactions. You can check an AMM's balances and the history of transactions that affected it the same way you would with a regular account.
|
||||
|
||||
|
||||
## AccountRoot ID Format
|
||||
|
||||
The ID of an AccountRoot object is the [SHA-512Half][] of the following values, concatenated in order:
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
---
|
||||
html: amm.html
|
||||
parent: ledger-object-types.html
|
||||
blurb: The definition and details of an Automated Market Maker (AMM) instance.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMM
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/c1e4bfb08bcc9f187d794a71d653003a6148dc68/src/ripple/protocol/impl/LedgerFormats.cpp#L265-L275 "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
The `AMM` object type describes a single Automated Market Maker (AMM) instance.
|
||||
|
||||
|
||||
## Example AMM JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"AMMAccount" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"AuctionSlot" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"AuthAccounts" : [
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv"
|
||||
}
|
||||
}
|
||||
],
|
||||
"DiscountedFee" : 0,
|
||||
"Expiration" : 721870180,
|
||||
"Price" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "0.8696263565463045"
|
||||
}
|
||||
},
|
||||
"Flags" : 0,
|
||||
"LPTokenBalance" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "71150.53584131501"
|
||||
},
|
||||
"TradingFee" : 600,
|
||||
"VoteSlots" : [
|
||||
{
|
||||
"VoteEntry" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"TradingFee" : 600,
|
||||
"VoteWeight" : 100000
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## AMM Fields
|
||||
|
||||
The `AMM` object has the following fields:
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-----------------|:--------------------|:------------------|:----------|--------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the two assets this AMM holds. In JSON, this is an object with `currency` and `issuer` fields. |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset this AMM holds. In JSON, this is an object with `currency` and `issuer` fields. |
|
||||
| `AMMAccount` | String | AccountID | Yes | The address of the [special account](accountroot.html#special-amm-accountroot-objects) that holds this AMM's assets. |
|
||||
| `AuctionSlot` | Object | STObject | No | Details of the current owner of the auction slot, as an [Auction Slot object](#auction-slot-object). |
|
||||
| `LPTokenBalance` | [Currency Amount][] | Amount | Yes | The total outstanding balance of liquidity provider tokens from this AMM instance. The holders of these tokens can vote on the AMM's trading fee in proportion to their holdings, or redeem the tokens for a share of the AMM's assets which grows with the trading fees collected. |
|
||||
| `TradingFee` | Number | UInt16 | Yes | The percentage fee to be charged for trades against this AMM instance, in units of 1/10,000. The maximum value is 1000, for a 1% fee. |
|
||||
| `VoteSlots` | Array | STArray | No | A list of vote objects, representing votes on the pool's trading fee. |
|
||||
|
||||
### Auction Slot Object
|
||||
|
||||
The `AuctionSlot` field contains an object with the following nested fields:
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:----------------|:--------------------|:------------------|:----------|:--|
|
||||
| `Account` | String - Address | AccountID | Yes | The current owner of this auction slot. |
|
||||
| `AuthAccounts` | Array | STArray | No | A list of at most 4 additional accounts that are authorized to trade at the discounted fee for this AMM instance. |
|
||||
| `DiscountedFee` | String | UInt32 | Yes | The trading fee to be charged to the auction owner, in the same format as `TradingFee`. By default this is 0, meaning that the auction owner can trade at no fee instead of the standard fee for this AMM. |
|
||||
| `Price` | [Currency Amount][] | Amount | Yes | The amount the auction owner paid to win this slot, in LP Tokens. |
|
||||
| `Expiration` | String | UInt32 | Yes | The time when this slot expires, in [seconds since the Ripple Epoch][]. |
|
||||
|
||||
## AMM Flags
|
||||
|
||||
There are currently no flags defined for `AMM` objects.
|
||||
|
||||
## AMM ID Format
|
||||
|
||||
The ID of an `AMM` object is the [SHA-512Half][] of the following values, concatenated in order:
|
||||
|
||||
1. The `AMM` space key (`0x0041`)
|
||||
0. The AccountID of the first asset's issuer.
|
||||
0. The 160-bit currency code of the first token.
|
||||
0. The AccountID of the second asset's issuer.
|
||||
0. The 160-bit currency code of the second token.
|
||||
|
||||
For XRP, use all 0's for both the token and the issuer.
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -184,6 +184,7 @@ curated_anchors:
|
||||
| [Hash256][] | 5 | 256 | いいえ | 256ビットの任意のバイナリ値。これは通常、トランザクション、レジャーバージョン、またはレジャーデータオブジェクトの「SHA-512ハーフ」ハッシュを表します。 |
|
||||
| [PathSet][] | 18 | 可変 | いいえ | [複数通貨間ペイメント](cross-currency-payments.html)の有効な[ペイメントパス](paths.html)のセット。 |
|
||||
| [STArray][] | 15 | 可変 | いいえ | 可変数のメンバーからなる配列。フィールドによってタイプが異なる場合があります。この例として、[memos](transaction-common-fields.html#memosフィールド)や[マルチ署名](multi-signing.html)で使用される署名者のリストがあります。 |
|
||||
| [STIssue][] | 24 | 320 | いいえ | :not_enabled: An asset definition, XRP or a token, with no quantity.<!-- TODO: translate --> |
|
||||
| [STObject][] | 14 | 可変 | いいえ | 1つ以上のネストされたフィールドを含むオブジェクト。 |
|
||||
| [UInt8][] | 16 | 8 | いいえ | 8ビットの符号なし整数。 |
|
||||
| [UInt16][] | 1 | 16 | いいえ | 16ビットの符号なし整数。`TransactionType`は、このタイプの特殊なフィールドで、特定の文字列から整数値へのマッピングを含みます。 |
|
||||
@@ -213,6 +214,7 @@ curated_anchors:
|
||||
|
||||
### Amountフィールド
|
||||
[Amount]: #amountフィールド
|
||||
<!-- TODO: update translation based on the English version, which moves in content from the Currency Formats page -->
|
||||
|
||||
「Amount」タイプは、通貨(XRPまたは発行済み通貨)の額を表す特殊なフィールドタイプです。このタイプは2つのサブタイプで構成されます。
|
||||
|
||||
@@ -266,6 +268,16 @@ XRP LedgerのハッシュタイプにはHash128、Hash160、Hash256がありま
|
||||
|
||||
これらのフィールドは、長さインディケーターを使用せずに、ビッグエンディアンバイトオーダーで特定数のビットとしてシリアル化されます。
|
||||
|
||||
### Issueフィールド
|
||||
[STIssue]: #issueフィールド
|
||||
<!-- TODO: translate this section -->
|
||||
|
||||
_(The "Issue" or "STIssue" type is part of multiple proposed extensions to the XRP Ledger protocol, including [XLS-30d: Automated Market Maker](https://github.com/XRPLF/XRPL-Standards/discussions/78) :not_enabled: and [Federated Sidechains](federated-sidechains.html) :not_enabled:)_
|
||||
|
||||
Some fields specify a _type_ of asset, which could be XRP or a fungible [token](tokens.html), without an amount. These fields have consist of two 160-bit segments in order:
|
||||
|
||||
1. The first 160 bits are the [currency code](currency-formats.html#通貨コード) of the asset. For XRP, this is all 0's.
|
||||
2. The next 160 bits are the [AccountID of the token issuer](#accountidフィールド). For XRP, this is all 0's.
|
||||
|
||||
### オブジェクトフィールド
|
||||
[STObject]: #オブジェクトフィールド
|
||||
|
||||
@@ -174,20 +174,21 @@ Field codes are reused for fields of different field types, but fields of the sa
|
||||
|
||||
Transaction instructions may contain fields of any of the following types:
|
||||
|
||||
| Type Name | Type Code | Bit Length | [Length-prefixed]? | Description |
|
||||
|:--------------|:----------|:-----------|:-------------------|----------------|
|
||||
| [AccountID][] | 8 | 160 | Yes | The unique identifier for an [account](accounts.html). |
|
||||
| [Amount][] | 6 | 64 or 384 | No | An amount of XRP or tokens. The length of the field is 64 bits for XRP or 384 bits (64+160+160) for tokens. |
|
||||
| [Blob][] | 7 | Variable | Yes | Arbitrary binary data. One important such field is `TxnSignature`, the signature that authorizes a transaction. |
|
||||
| [Hash128][] | 4 | 128 | No | A 128-bit arbitrary binary value. The only such field is `EmailHash`, which is intended to store the MD-5 hash of an account owner's email for purposes of fetching a [Gravatar](https://www.gravatar.com/). |
|
||||
| [Hash160][] | 17 | 160 | No | A 160-bit arbitrary binary value. This may define a currency code or issuer. |
|
||||
| [Hash256][] | 5 | 256 | No | A 256-bit arbitrary binary value. This usually represents the "SHA-512Half" hash of a transaction, ledger version, or ledger data object. |
|
||||
| [PathSet][] | 18 | Variable | No | A set of possible [payment paths](paths.html) for a [cross-currency payment](cross-currency-payments.html). |
|
||||
| [STArray][] | 15 | Variable | No | An array containing a variable number of members, which can be different types depending on the field. Two cases of this include [memos](transaction-common-fields.html#memos-field) and lists of signers used in [multi-signing](multi-signing.html). |
|
||||
| [STObject][] | 14 | Variable | No | An object containing one or more nested fields. |
|
||||
| [UInt8][] | 16 | 8 | No | An 8-bit unsigned integer. |
|
||||
| [UInt16][] | 1 | 16 | No | A 16-bit unsigned integer. The `TransactionType` is a special case of this type, with specific strings mapping to integer values. |
|
||||
| [UInt32][] | 2 | 32 | No | A 32-bit unsigned integer. The `Flags` and `Sequence` fields on all transactions are examples of this type. |
|
||||
| Type Name | Type Code | Bit Length | [Length-prefixed][]? | Description |
|
||||
|:--------------|:----------|:-----------|:---------------------|----------------|
|
||||
| [AccountID][] | 8 | 160 | Yes | The unique identifier for an [account](accounts.html). |
|
||||
| [Amount][] | 6 | 64 or 384 | No | An amount of XRP or tokens. The length of the field is 64 bits for XRP or 384 bits (64+160+160) for tokens. |
|
||||
| [Blob][] | 7 | Variable | Yes | Arbitrary binary data. One important such field is `TxnSignature`, the signature that authorizes a transaction. |
|
||||
| [Hash128][] | 4 | 128 | No | A 128-bit arbitrary binary value. The only such field is `EmailHash`, which is intended to store the MD-5 hash of an account owner's email for purposes of fetching a [Gravatar](https://www.gravatar.com/). |
|
||||
| [Hash160][] | 17 | 160 | No | A 160-bit arbitrary binary value. This may define a currency code or issuer. |
|
||||
| [Hash256][] | 5 | 256 | No | A 256-bit arbitrary binary value. This usually represents the "SHA-512Half" hash of a transaction, ledger version, or ledger data object. |
|
||||
| [PathSet][] | 18 | Variable | No | A set of possible [payment paths](paths.html) for a [cross-currency payment](cross-currency-payments.html). |
|
||||
| [STArray][] | 15 | Variable | No | An array containing a variable number of members, which can be different types depending on the field. Two cases of this include [memos](transaction-common-fields.html#memos-field) and lists of signers used in [multi-signing](multi-signing.html). |
|
||||
| [STIssue][] | 24 | 320 | No | :not_enabled: An asset definition, XRP or a token, with no quantity. |
|
||||
| [STObject][] | 14 | Variable | No | An object containing one or more nested fields. |
|
||||
| [UInt8][] | 16 | 8 | No | An 8-bit unsigned integer. |
|
||||
| [UInt16][] | 1 | 16 | No | A 16-bit unsigned integer. The `TransactionType` is a special case of this type, with specific strings mapping to integer values. |
|
||||
| [UInt32][] | 2 | 32 | No | A 32-bit unsigned integer. The `Flags` and `Sequence` fields on all transactions are examples of this type. |
|
||||
|
||||
[Length-prefixed]: #length-prefixing
|
||||
|
||||
@@ -299,6 +300,16 @@ The XRP Ledger has several "hash" types: Hash128, Hash160, and Hash256. These fi
|
||||
|
||||
All such fields are serialized as the specific number of bits, with no length indicator, in big-endian byte order.
|
||||
|
||||
### Issue Fields
|
||||
[STIssue]: #issue-fields
|
||||
|
||||
_(The "Issue" or "STIssue" type is part of multiple proposed extensions to the XRP Ledger protocol, including [XLS-30d: Automated Market Maker](https://github.com/XRPLF/XRPL-Standards/discussions/78) :not_enabled: and [Federated Sidechains](federated-sidechains.html) :not_enabled:)_
|
||||
|
||||
Some fields specify a _type_ of asset, which could be XRP or a fungible [token](tokens.html), without an amount. These fields have consist of two 160-bit segments in order:
|
||||
|
||||
1. The first 160 bits are the [currency code](#currency-codes) of the asset. For XRP, this is all 0's.
|
||||
2. The next 160 bits are the [AccountID of the token issuer](#accountid-fields). For XRP, this is all 0's.
|
||||
|
||||
|
||||
### Object Fields
|
||||
[STObject]: #object-fields
|
||||
|
||||
@@ -15,6 +15,14 @@ For the most part, transactions with `tec` codes take no action other than to de
|
||||
|
||||
| Code | Value | Explanation |
|
||||
|:---------------------------|:------|:----------------------------------------|
|
||||
| `tecAMM_BALANCE` | 163 |
|
||||
| `tecAMM_DIRECT_PAYMENT` | 169 | The transaction tried to send money directly to an AccountRoot object that is part of an Automated Market Maker (AMM) :not_enabled:. AMM AccountRoot entries cannot send or receive money directly except through [AMMWithdraw][] and [AMMDeposit][] transactions. |
|
||||
| `tecAMM_EXISTS` | 167 | The [AMMCreate transaction][] :not_enabled: tried to create an Automated Market Maker (AMM) instance that already exists. There can only be at most one AMM per unique currency pair. |
|
||||
| `tecAMM_FAILED_DEPOSIT` | 164 | The [AMMDeposit transaction][] :not_enabled: failed, probably because the sender does not have enough of the specified assets, or because the deposit requested an effective price that isn't possible with the available amounts. |
|
||||
| `tecAMM_FAILED_WITHDRAW` | 165 | The [AMMWithdraw transaction][] :not_enabled: failed, probably because the sender does not have enough LP Tokens, or because the withdraw requested an effective price that isn't possible with the available amounts. |
|
||||
| `tecAMM_FAILED_BID` | 168 | The [AMMBid transaction][] :not_enabled: failed, probably because the price to win the auction was higher than the specified maximum value or the sender's current balance. |
|
||||
| `tecAMM_FAILED_VOTE` | 170 | The [AMMVote transaction][] :not_enabled: failed, probably because there are already too many votes from accounts that hold more LP Tokens for this AMM. (This can still recalculate the AMM's trading fee.) |
|
||||
| `tecAMM_INVALID_TOKENS` | 166 | The AMM-related transaction :not_enabled: failed due to insufficient LP Tokens or problems with rounding; for example, depositing a very small amount of assets could fail if the amount of LP Tokens to be returned rounds down to zero. |
|
||||
| `tecCANT_ACCEPT_OWN_NFTOKEN_OFFER` | 157 | The transaction tried to accept an offer that was placed by the same account to buy or sell a [non-fungible token](non-fungible-tokens.html). _(Added by the [NonFungibleTokensV1_1 amendment][].)_ |
|
||||
| `tecCLAIM` | 100 | Unspecified failure, with transaction cost destroyed. |
|
||||
| `tecCRYPTOCONDITION_ERROR` | 146 | This [EscrowCreate][] or [EscrowFinish][] transaction contained a malformed or mismatched crypto-condition. |
|
||||
@@ -59,6 +67,7 @@ For the most part, transactions with `tec` codes take no action other than to de
|
||||
| `tecTOO_SOON` | 152 | The [AccountDelete transaction][] failed because the account to be deleted had a `Sequence` number that is too high. The current ledger index must be at least 256 higher than the account's sequence number. |
|
||||
| `tecUNFUNDED` | 129 | The transaction failed because the account does not hold enough XRP to pay the amount in the transaction _and_ satisfy the additional [reserve](reserves.html) necessary to execute this transaction. |
|
||||
| `tecUNFUNDED_ADD` | 102 | **DEPRECATED.** |
|
||||
| `tecUNFUNDED_AMM` | 162 | The [AMMCreate transaction][] :not_enabled: failed because the sender does not have enough of the specified assets to fund it. |
|
||||
| `tecUNFUNDED_PAYMENT` | 104 | The transaction failed because the sending account is trying to send more XRP than it holds, not counting the [reserve](reserves.html). |
|
||||
| `tecUNFUNDED_OFFER` | 103 | The [OfferCreate transaction][] failed because the account creating the offer does not have any of the `TakerGets` currency. |
|
||||
|
||||
|
||||
@@ -11,10 +11,12 @@ These codes indicate that the transaction was malformed, and cannot succeed acco
|
||||
|
||||
**Tip:** Transactions with `tem` codes are not applied to ledgers, and cannot cause any changes to XRP Ledger state. A `tem` result is final unless the rules for a valid transaction change. (For example, using functionality from an [Amendment](amendments.html) before that amendment is enabled results in `temDISABLED`; such a transaction could succeed later if it becomes valid when the amendment is enabled.)
|
||||
|
||||
| Code | Explanation |
|
||||
|:-----------------------------|:----------------------------------------------|
|
||||
| Code | Explanation |
|
||||
|:------------------------------|:----------------------------------------------|
|
||||
| `temBAD_AMM_OPTIONS` | The AMM-related transaction :not_enabled: specified a combination of parameters that is invalid. |
|
||||
| `temBAD_AMM_TOKENS` | The AMM-related transaction :not_enabled: specified its LP Tokens in an invalid format or specified LP Tokens for the wrong AMM instance. |
|
||||
| `temBAD_AMOUNT` | An amount specified by the transaction (for example the destination `Amount` or `SendMax` values of a [Payment][]) was invalid, possibly because it was a negative number. |
|
||||
| `temBAD_AUTH_MASTER` | The key used to sign this transaction does not match the master key for the account sending it, and the account does not have a [Regular Key](cryptographic-keys.html) set. |
|
||||
| `temBAD_AUTH_MASTER` | The key used to sign this transaction does not match the master key for the account sending it, and the account does not have a [Regular Key](cryptographic-keys.html) set. |
|
||||
| `temBAD_CURRENCY` | The transaction improperly specified a currency field. See [Specifying Currency Amounts][Currency Amount] for the correct format. |
|
||||
| `temBAD_EXPIRATION` | The transaction improperly specified an expiration value, for example as part of an [OfferCreate transaction][]. Alternatively, the transaction did not specify a required expiration value, for example as part of an [EscrowCreate transaction][]. |
|
||||
| `temBAD_FEE` | The transaction improperly specified its `Fee` value, for example by listing a non-XRP currency or some negative amount of XRP. |
|
||||
@@ -43,6 +45,8 @@ These codes indicate that the transaction was malformed, and cannot succeed acco
|
||||
| `temREDUNDANT` | The transaction would do nothing; for example, it is sending a payment directly to the sending account, or creating an offer to buy and sell the same currency from the same issuer. |
|
||||
| `temREDUNDANT_SEND_MAX` | [Removed in: rippled 0.28.0][] |
|
||||
| `temRIPPLE_EMPTY` | The [Payment transaction][] includes an empty `Paths` field, but paths are necessary to complete this payment. |
|
||||
| `temBAD_AMM_OPTIONS` | The transaction specified an invalid combination of options regarding an Automated Market Maker (AMM). :not_enabled: |
|
||||
| `temBAD_AMM_TOKENS` | The transaction incorrectly specified an Automated Market Maker's LP Tokens. :not_enabled: |
|
||||
| `temBAD_WEIGHT` | The [SignerListSet transaction][] includes a `SignerWeight` that is invalid, for example a zero or negative value. |
|
||||
| `temBAD_SIGNER` | The [SignerListSet transaction][] includes a signer who is invalid. For example, there may be duplicate entries, or the owner of the SignerList may also be a member. |
|
||||
| `temBAD_QUORUM` | The [SignerListSet transaction][] has an invalid `SignerQuorum` value. Either the value is not greater than zero, or it is more than the sum of all signers in the list. |
|
||||
|
||||
@@ -17,6 +17,7 @@ labels:
|
||||
| `terINSUF_FEE_B` | トランザクションの送信元アカウントに、トランザクションに指定されている`Fee`の支払いに十分なXRPがありません。 |
|
||||
| `terLAST` | 内部使用のみ。通常はこのコードは返されません。 |
|
||||
| `terNO_ACCOUNT` | レジャーのトランザクション送信元アドレスに(まだ)資金が供給されていません。 |
|
||||
| `terNO_AMM` | The AMM-related transaction :not_enabled: specifies an asset pair that does not currently have an AMM instance. <!-- TODO: translate --> |
|
||||
| `terNO_AUTH` | トランザクションでは、`lsfRequireAuth`が有効であるアカウントが発行した通貨を未承認のトラストラインに追加する操作が行われます。たとえば、保有が許可されていない通貨を購入するオファーを出した場合などです。 |
|
||||
| `terNO_LINE` | 内部使用のみ。通常はこのコードは返されません。 |
|
||||
| `terNO_RIPPLE` | 内部使用のみ。通常はこのコードは返されません。 |
|
||||
|
||||
@@ -13,18 +13,19 @@ These codes indicate that the transaction failed, but it could apply successfull
|
||||
|
||||
| Code | Explanation |
|
||||
|:-----------------|:----------------------------------------------------------|
|
||||
| `terFUNDS_SPENT` | **DEPRECATED.** |
|
||||
| `terFUNDS_SPENT` | **DEPRECATED.** |
|
||||
| `terINSUF_FEE_B` | The account sending the transaction does not have enough XRP to pay the `Fee` specified in the transaction. |
|
||||
| `terLAST` | Used internally only. This code should never be returned. |
|
||||
| `terNO_ACCOUNT` | The address sending the transaction is not funded in the ledger (yet). |
|
||||
| `terNO_AUTH` | The transaction would involve adding currency issued by an account with `lsfRequireAuth` enabled to a trust line that is not authorized. For example, you placed an offer to buy a currency you aren't authorized to hold. |
|
||||
| `terNO_LINE` | Used internally only. This code should never be returned. |
|
||||
| `terNO_RIPPLE` | Used internally only. This code should never be returned. |
|
||||
| `terOWNERS` | The transaction requires that account sending it has a nonzero "owners count", so the transaction cannot succeed. For example, an account cannot enable the [`lsfRequireAuth`](accountset.html#accountset-flags) flag if it has any trust lines or available offers. |
|
||||
| `terPRE_SEQ` | The `Sequence` number of the current transaction is higher than the current sequence number of the account sending the transaction. |
|
||||
| `terPRE_TICKET` | The transaction attempted to use a [Ticket](tickets.html), but the specified `TicketSequence` number does not exist in the ledger. However, the Ticket could still be created by another transaction. |
|
||||
| `terRETRY` | Unspecified retriable error. |
|
||||
| `terQUEUED` | The transaction met the load-scaled [transaction cost](transaction-cost.html) but did not meet the open ledger requirement, so the transaction has been queued for a future ledger. |
|
||||
| `terLAST` | Used internally only. This code should never be returned. |
|
||||
| `terNO_ACCOUNT` | The address sending the transaction is not funded in the ledger (yet). |
|
||||
| `terNO_AMM` | The AMM-related transaction :not_enabled: specifies an asset pair that does not currently have an AMM instance. |
|
||||
| `terNO_AUTH` | The transaction would involve adding currency issued by an account with `lsfRequireAuth` enabled to a trust line that is not authorized. For example, you placed an offer to buy a currency you aren't authorized to hold. |
|
||||
| `terNO_LINE` | Used internally only. This code should never be returned. |
|
||||
| `terNO_RIPPLE` | Used internally only. This code should never be returned. |
|
||||
| `terOWNERS` | The transaction requires that account sending it has a nonzero "owners count", so the transaction cannot succeed. For example, an account cannot enable the [`lsfRequireAuth`](accountset.html#accountset-flags) flag if it has any trust lines or available offers. |
|
||||
| `terPRE_SEQ` | The `Sequence` number of the current transaction is higher than the current sequence number of the account sending the transaction. |
|
||||
| `terPRE_TICKET` | The transaction attempted to use a [Ticket](tickets.html), but the specified `TicketSequence` number does not exist in the ledger. However, the Ticket could still be created by another transaction. |
|
||||
| `terRETRY` | Unspecified retriable error. |
|
||||
| `terQUEUED` | The transaction met the load-scaled [transaction cost](transaction-cost.html) but did not meet the open ledger requirement, so the transaction has been queued for a future ledger. |
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
---
|
||||
html: ammbid.html
|
||||
parent: transaction-types.html
|
||||
blurb: Bid on an Automated Market Maker's auction slot, which grants a discounted fee.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMBid
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMBid.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Bid on an Automated Market Maker's (AMM's) auction slot. If you win, you can trade against the AMM at a discounted fee until you are outbid or 24 hours have passed. If you are outbid before 24 hours have passed, you are refunded part of the cost of your bid based on how much time remains.
|
||||
|
||||
You bid using the AMM's LP Tokens; the amount of a winning bid is returned to the AMM, decreasing the outstanding balance of LP Tokens.
|
||||
|
||||
|
||||
## Example {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"AuthAccounts" : [
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv"
|
||||
}
|
||||
}
|
||||
],
|
||||
"BidMax" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "100"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 9,
|
||||
"TransactionType" : "AMMBid"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:---------------|:--------------------|:------------------|:----------|:------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the assets in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `BidMin` | [Currency Amount][] | Amount | No | Pay at least this amount for the slot. Setting this value higher makes it harder for others to outbid you. If omitted, pay the minimum necessary to win the bid. |
|
||||
| `BidMax` | [Currency Amount][] | Amount | No | Pay at most this amount for the slot. If the cost to win the bid is higher than this amount, the transaction fails. If omitted, pay as much as necessary to win the bid. |
|
||||
| `AuthAccounts` | Array | STArray | No | A list of up to 4 additional accounts that you allow to trade at the discounted fee. This cannot include the address of the transaction sender. Each of these objects should be an [AuthAccount object](#authaccount-objects). |
|
||||
|
||||
You cannot specify both `BidMin` and `BidMax`.
|
||||
|
||||
### AuthAccount Objects
|
||||
|
||||
Each member of the `AuthAccounts` array must be an object with the following field:
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:---------------|:----------|:------------------|:----------|:------------|
|
||||
| `Account` | String | AccountID | Yes | The address of the account to authorize. |
|
||||
|
||||
Like other "inner objects" that can appear in arrays, the JSON representation of each of these objects is wrapped in an object whose only key is the object type, `AuthAccount`.
|
||||
|
||||
## Auction Slot Price
|
||||
|
||||
If successful, the transaction automatically outbids the previous slot owner and debits the bid price from the sender's LP Tokens. The price to win the auction decreases over time, divided into 20 intervals of 72 minutes each. If the sender does not have enough LP Tokens to win the bid, or the price of the bid is higher than the transaction's `BidMax` value, the transaction fails with a `tecAMM_FAILED_BID` result.
|
||||
|
||||
- If the auction slot is currently empty, expired, or in its last interval, the **minimum bid** is **0.001% of the AMM's total LP Tokens balance**.
|
||||
|
||||
**Caution:** This minimum value is a placeholder and may change before the AMM feature becomes finalized.
|
||||
|
||||
- Otherwise, the price to outbid the current holder is calculated using the following formula:
|
||||
|
||||
P = B × 1.05 × (1 - t⁶⁰) + M
|
||||
|
||||
- `P` is the price to outbid, in LP Tokens.
|
||||
- `B` is the price of the current bid, in LP Tokens.
|
||||
- `t` is the fraction of time elapsed in the current 24-hour slot, rounded down to a multiple of 0.05.
|
||||
- `M` is the **minimum bid** as defined above.
|
||||
|
||||
There are two special cases for the cost to outbid someone. In the **first interval** after someone wins the bid, the price to outbid them is the minimum bid plus 5% more than the existing bid:
|
||||
|
||||
P = B × 1.05 + M
|
||||
|
||||
In the **last interval** of someone's slot, the cost to outbid someone is only the minimum bid:
|
||||
|
||||
P = M
|
||||
|
||||
**Note:** To make sure all servers in the network reach the same results when building a ledger, time measurements are based on the [official close time](ledgers.html#ledger-close-times) of the previous ledger, which is approximate.
|
||||
|
||||
## Bid Refunds
|
||||
|
||||
When you outbid an active auction slot, the AMM refunds the previous holder part of the price, using this formula:
|
||||
|
||||
```text
|
||||
R = B × (1 - t)
|
||||
```
|
||||
|
||||
- `R` is the amount to refund, in LP Tokens.
|
||||
- `B` is the price of the previous bid to be refunded, in LP Tokens.
|
||||
- `t` is the fraction of time elapsed in the current 24-hour slot, rounded down to a multiple of 0.05.
|
||||
|
||||
As a special case, during the final (20th) interval of the auction slot, the refunded amount is zero.
|
||||
|
||||
**Note:** As with all XRP Ledger times, transaction processing uses the [official close time](ledgers.html#ledger-close-times) of the _previous_ ledger, which can result in a difference of up to about 10 seconds from real time.
|
||||
|
||||
|
||||
## AMM Cases previous holder
|
||||
In addition to errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:------------------------|:---------------------------------------------|
|
||||
| `tecAMM_FAILED_BID` | This transaction could not win the auction, either because the sender does not hold enough LP Tokens to pay the necessary bid or because the price to win the auction was higher than the transaction's specified `BidMax` value. |
|
||||
| `tecAMM_INVALID_TOKENS` | The sender of this transaction does not hold enough LP Tokens to meet the slot price. |
|
||||
| `temBAD_AMM_TOKENS` | The specified `BidMin` or `BidMax` were not specified as the correct LP Tokens for this AMM. |
|
||||
| `temBAD_AMM_OPTIONS` | The transaction specified invalid options, such as a list of `AuthAccounts` that is too long, or specifying both `BidMin` and `BidMax`. |
|
||||
| `temDISABLED` | The AMM feature :not_enabled: is not enabled on this network. |
|
||||
| `terNO_ACCOUNT` | One of the accounts specified in this request do not exist. |
|
||||
| `terNO_AMM` | The Automated Market Maker instance for the asset pair in this transaction does not exist. |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -0,0 +1,71 @@
|
||||
---
|
||||
html: ammcreate.html
|
||||
parent: transaction-types.html
|
||||
blurb: Create a new AMM instance for trading a given pair of assets.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMCreate
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMCreate.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Create a new Automated Market-Maker (AMM) instance for trading a pair of assets ([fungible tokens](tokens.html) or [XRP](xrp.html)).
|
||||
|
||||
Creates both an [AMM object][] and a [special AccountRoot object](accountroot.html#special-amm-accountroot-objects) 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](https://www.machow.ski/posts/an_introduction_to_automated_market_makers/#price-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 {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Amount" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value" : "25"
|
||||
},
|
||||
"Amount2" : "250000000",
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 6,
|
||||
"TradingFee" : 500,
|
||||
"TransactionType" : "AMMCreate"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
<!--{# fix md highlighting_ #}-->
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-------------|:--------------------|:------------------|:----------|:------------|
|
||||
| `Amount` | [Currency Amount][] | Amount | Yes | The first of the two assets to fund this AMM with. This must be a positive amount. |
|
||||
| `Amount2` | [Currency Amount][] | Amount | Yes | The second of the two assets to fund this AMM with. This must be a positive amount. |
|
||||
| `TradingFee` | Number | UInt16 | Yes | 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`. |
|
||||
|
||||
One or both of `Amount` and `Amount2` can be [tokens](tokens.html); at most one of them can be [XRP](xrp.html). They cannot both have the same currency code and issuer. An AMM's LP tokens _can_ be used as one of the assets for another AMM.
|
||||
|
||||
## Error Cases
|
||||
|
||||
In addition to errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:--------------------|:---------------------------------------------|
|
||||
| `temDISABLED` | The AMM feature :not_enabled: is not enabled on this network. |
|
||||
| `temINVALID_FLAG` | The transaction specified an invalid `Flags` value. Since there are currently no flags defined for this transaction type, only [Global Flags](transaction-common-fields.html#global-flags) are allowed. |
|
||||
| `temBAD_AMM_TOKENS` | The values of `Amount` and `Amount2` are not valid: for example, both refer to the same token. |
|
||||
| `temBAD_FEE` | The `TradingFee` value is invalid. It must be zero or a positive integer and cannot be over 1000. |
|
||||
| `terNO_ACCOUNT` | One of the accounts referenced in the request does not exist. |
|
||||
| `tecNO_AUTH` | The sender is not authorized to hold one of the deposit assets (`Amount` or `Amount2`). |
|
||||
| `tecNO_LINE` | The sender does not have a trust line for one of the deposit assets (`Amount` or `Amount2`). |
|
||||
| `tecFROZEN` | At least one of the deposit assets (`Amount` or `Amount2`) is currently [frozen](freezes.html). |
|
||||
| `tecUNFUNDED_AMM` | The sender does not hold enough money to fund the AMM with the amounts specified in `Amount` and `Amount2`. |
|
||||
| `tecAMM_EXISTS` | There is already another AMM trading this currency pair. |
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -0,0 +1,137 @@
|
||||
---
|
||||
html: ammdeposit.html
|
||||
parent: transaction-types.html
|
||||
blurb: Deposit funds into an Automated Market Maker in exchange for LPTokens.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMDeposit
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMDeposit.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Deposit funds into an Automated Market-Maker (AMM) instance and receive the AMM's liquidity provider tokens (_LP Tokens_) in exchange. You can deposit one or both of the assets in the AMM's pool.
|
||||
|
||||
If successful, this transaction creates a [trust line](trust-lines-and-issuing.html) to the AMM Account (limit 0) to hold the LP Tokens.
|
||||
|
||||
## Example {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Amount" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value" : "2.5"
|
||||
},
|
||||
"Amount2" : "30000000",
|
||||
"Asset" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 1048576,
|
||||
"Sequence" : 7,
|
||||
"TransactionType" : "AMMDeposit"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:--------------|:--------------------|:------------------|:----------|:------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the assets in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Amount` | [Currency Amount][] | Amount | No | The amount of one asset to deposit to the AMM. If present, this must match the type of one of the assets (tokens or XRP) in the AMM's pool. |
|
||||
| `Amount2` | [Currency Amount][] | Amount | No | The amount of another asset to add to the AMM. If present, this must match the type of the other asset in the AMM's pool and cannot be the same asset as `Amount`. |
|
||||
| `EPrice` | [Currency Amount][] | Amount | No | The maximum effective price, in the deposit asset, to pay for each LP Token received. |
|
||||
| `LPTokenOut` | [Currency Amount][] | Amount | No | How many of the AMM's LP Tokens to buy. |
|
||||
|
||||
|
||||
### AMMDeposit Modes
|
||||
|
||||
This transaction has five modes, defined by which flag you specify. Each mode expects a specific combination of fields. The modes fall into two categories:
|
||||
|
||||
- **Double-asset deposits**, in which you provide both assets in the AMM's pool, proportional to the balance of the assets already there. These deposits are not subject to a fee.
|
||||
- **Single-asset deposits**, in which you provide only one of the AMM's two assets. The AMM charges a fee, debited from the LP Tokens paid out, based on how much your deposit shifts the balance of assets in the pool.
|
||||
|
||||
The following combinations of fields indicate a **double-asset deposit**:
|
||||
|
||||
| Flag Name | Flag Value | Fields Specified | Meaning |
|
||||
|--------------|--------------|------------------------|---------|
|
||||
| `tfLPToken` | `0x00010000` | `LPTokenOut` only | Deposit both of this AMM's assets, in amounts calculated so that you receive the specified amount of LP Tokens in return. The amounts deposited maintain the relative proportions of the two assets the AMM already holds. |
|
||||
| `tfTwoAsset` | `0x00100000` | `Amount` and `Amount2` | Deposit both of this AMM's assets, up to the specified amounts. The actual amounts deposited must maintain the same balance of assets as the AMM already holds, so the amount of either one deposited MAY be less than specified. The amount of LP Tokens you get in return is based on the total value deposited. |
|
||||
|
||||
The following combinations of fields indicate a **single asset deposit**:
|
||||
|
||||
| Flag Name | Flag Value | Fields Specified | Meaning |
|
||||
|---------------------|--------------|----------------------------|---------|
|
||||
| `tfSingleAsset` | `0x00080000` | `Amount` only | Deposit exactly the specified amount of one asset, and receive an amount of LP Tokens based on the resulting share of the pool (minus fees). |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | `Amount` and `LPTokenOut` | Deposit up to the specified amount of one asset, so that you receive exactly the specified amount of LP Tokens in return (after fees). |
|
||||
| `tfLimitLPToken` | `0x00400000` | `Amount` and `EPrice` | Deposit up to the specified amount of one asset, but pay no more than the specified effective price per LP Token (after fees). |
|
||||
|
||||
Any other combination of these fields and flags is invalid.
|
||||
|
||||
|
||||
### Single Asset Deposit Fee
|
||||
|
||||
The fee for a single asset deposit is calculated to be the same as if you had used the AMM to trade part of the deposit amount for the other asset, then performed a double-asset deposit. The AMM's trading fee applies to the amount you would need to trade for, but not to the rest of the deposit. _For example, if the AMM's asset pool is split perfectly evenly between USD and EUR, and you try to deposit 100 USD, the amount of LP Tokens you receive is slightly less than if you had deposited 50 EUR + 50 USD, because you pay the trading fee to convert some of your USD to an equal amount of EUR._
|
||||
|
||||
The formula for how many LP Tokens you receive for a double-asset deposit is:
|
||||
|
||||
{{ include_svg("img/amm-single-asset-deposit-formula.svg", "L = T × ( (( 1 + (B - (F × (1 - W) × B)) ÷ P)^W) - 1)") }}
|
||||
<!-- TODO: improve graphic -->
|
||||
|
||||
Where:
|
||||
|
||||
- `L` is the amount of LP Tokens returned
|
||||
- `T` is the total outstanding LP Tokens before the deposit
|
||||
- `B` is the amount of the asset being deposited
|
||||
- `F` is the trading fee, as a decimal
|
||||
- `W` is the weight of the deposit asset in the pool. This is defined as 0.5 for all AMM pools (meaning a 50/50 split), so exponentiation by W is equivalent to taking the square root.
|
||||
- `P` is the total amount of the deposit asset in the pool before the deposit
|
||||
|
||||
### AMMDeposit Flags
|
||||
|
||||
Transactions of the AMMDeposit type support additional values in the [`Flags` field](transaction-common-fields.html#flags-field), as follows:
|
||||
|
||||
| Flag Name | Hex Value | Decimal Value | Description |
|
||||
|:--------------------|:-------------|:--------------|:----------------------|
|
||||
| `tfLPToken` | `0x00010000` | 65536 | Perform a double-asset deposit and receive the specified amount of LP Tokens. |
|
||||
| `tfSingleAsset` | `0x00080000` | 524288 | Perform a single-asset deposit with a specified amount of the asset to deposit. |
|
||||
| `tfTwoAsset` | `0x00100000` | 1048576 | Perform a double-asset deposit with specified amounts of both assets. |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | 2097152 | Perform a single-asset deposit and receive the specified amount of LP Tokens. |
|
||||
| `tfLimitLPToken` | `0x00400000` | 4194304 | Perform a single-asset deposit with a specified effective price. |
|
||||
|
||||
You must specify **exactly one** of these flags, in addition to any [global flags](transaction-common-fields.html#global-flags).
|
||||
|
||||
|
||||
## Error Cases
|
||||
|
||||
In addition to errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:------------------------|:---------------------------------------------|
|
||||
| `temBAD_AMM_OPTIONS` | The transaction specified an invalid combination of fields. See [AMMDeposit Modes](#ammdeposit-modes). |
|
||||
| `tecFROZEN` | The transaction tried to deposit a [frozen](freezes.html) token. |
|
||||
| `tecAMM_BALANCE` | The AMM does not have enough of one of the assets to accept the deposit (for example, to satisfy the trade portion of a single-asset deposit) or the sender does not have enough of a given token. |
|
||||
| `temBAD_AMM_TOKENS` | The transaction specified the LP Tokens incorrectly; for example, the `issuer` is not the AMM's associated AccountRoot address or the `currency` is not the currency code for this AMM's LP Tokens, or the transaction specified this AMM's LP Tokens in one of the asset fields. |
|
||||
| `tecAMM_FAILED_DEPOSIT` | The conditions on the deposit could not be satisfied; for example, the requested effective price in the `EPrice` field is too low. |
|
||||
| `tecAMM_INVALID_TOKENS` | The AMM for this token pair does not exist, or one of the calculations resulted in a deposit amount rounding to zero. |
|
||||
| `tecINSUF_RESERVE_LINE` | The sender of this transaction does meet the increased [reserve requirement](reserves.html) 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_AUTH` | The sender is not authorized to hold one of the deposit assets. |
|
||||
| `tecNO_LINE` | The sender does not have a trust line for one of the deposit assets. |
|
||||
| `tecUNFUNDED_AMM` | The sender does not have a high enough balance to make the specified deposit. |
|
||||
| `terNO_ACCOUNT` | An account specified in the request does not exist. |
|
||||
| `terNO_AMM` | The Automated Market Maker instance for the asset pair in this transaction does not exist. |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
html: ammvote.html
|
||||
parent: transaction-types.html
|
||||
blurb: Vote on the trading fee for an Automated Market Maker instance.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMVote
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMVote.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Vote on the trading fee for an Automated Market Maker instance. Up to 8 accounts can vote in proportion to the amount of the AMM's LP Tokens they hold. Each new vote re-calculates the AMM's trading fee based on a weighted average of the votes.
|
||||
|
||||
## Example {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 8,
|
||||
"TradingFee" : 600,
|
||||
"TransactionType" : "AMMVote"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-------------|:----------|:------------------|:----------|:------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the assets in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `TradingFee` | Number | UInt16 | Yes | The proposed fee to vote for, in units of 1/100,000; a value of 1 is equivalent to 0.001%. The maximum value is 1000, indicating a 1% fee. |
|
||||
|
||||
## Error Cases
|
||||
|
||||
In addition to errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:------------------------|:---------------------------------------------|
|
||||
| `tecAMM_INVALID_TOKENS` | The sender cannot vote because they do not hold any of this AMM's LP Tokens. |
|
||||
| `tecAMM_FAILED_VOTE` | There are already 8 votes from accounts that hold more LP Tokens than the sender of this transaction. |
|
||||
| `terNO_ACCOUNT` | An account specified in this transaction does not exist. |
|
||||
| `temBAD_FEE` | The `TradingFee` from this transaction is not valid. |
|
||||
| `terNO_AMM` | The Automated Market Maker instance for the asset pair in this transaction does not exist. |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -0,0 +1,125 @@
|
||||
---
|
||||
html: ammwithdraw.html
|
||||
parent: transaction-types.html
|
||||
blurb: Return LPTokens into an Automated Market Maker in exchange for a share of the assets the pool holds.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMWithdraw
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMWithdraw.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Withdraw assets from an Automated Market-Maker (AMM) instance by returning the AMM's liquidity provider tokens (LP Tokens).
|
||||
|
||||
## Example {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Amount" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value" : "5"
|
||||
},
|
||||
"Amount2" : "50000000",
|
||||
"Asset" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 1048576,
|
||||
"Sequence" : 10,
|
||||
"TransactionType" : "AMMWithdraw"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-------------|:--------------------|:------------------|:----------|:------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the assets in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Amount` | [Currency Amount][] | Amount | No | The amount of one asset to withdraw from the AMM. This must match the type of one of the assets (tokens or XRP) in the AMM's pool. |
|
||||
| `Amount2` | [Currency Amount][] | Amount | No | The amount of another asset to withdraw from the AMM. If present, this must match the type of the other asset in the AMM's pool and cannot be the same type as `Amount`. |
|
||||
| `EPrice` | [Currency Amount][] | Amount | No | The minimum effective price, in LP Token returned, to pay per unit of the asset to withdraw. |
|
||||
| `LPTokenIn` | [Currency Amount][] | Amount | No | How many of the AMM's LP Tokens to redeem. |
|
||||
|
||||
**Note:** For a two-asset withdrawal, it is possible for `Asset` to correspond to _either_ `Amount` or `Amount2` as long as `Asset2` corresponds to the other one. It is recommended to match them (that is, `Amount2` is an amount of the asset defined in `Asset2`) because it is less confusing that way.
|
||||
|
||||
### AMMWithdraw Modes
|
||||
|
||||
This transaction has several modes, depending on which flags you specify. Each mode expects a specific combination of fields. The modes fall into two categories:
|
||||
|
||||
- **Double-asset withdrawals**, in which you receive both assets from the AMM's pool in proportions that match their balances there. These withdrawals are not subject to a fee.
|
||||
- **Single-asset withdrawals**, in which you receive one asset from the AMM's pool. The AMM charges a fee based on how much your deposit shifts the balance of assets in the pool. Depending on the withdraw mode, the amount of the fee can be added to the amount of LP Tokens paid in, or debited from the amount of the asset paid out.
|
||||
|
||||
The following modes are for a **double-asset withdrawal**:
|
||||
|
||||
| Flag Name(s) | Flag Value | Fields Specified | Meaning |
|
||||
|-----------------|--------------|------------------------|---------|
|
||||
| `tfLPToken` | `0x00010000` | `LPTokenIn` only | Return the specified amount of LP Tokens and receive both assets from the AMM's pool in amounts based on the returned LP Tokens' share of the total LP Tokens issued. |
|
||||
| `tfWithdrawAll` | `0x00020000` | No Fields | Return _all_ of your LP Tokens and receive as much as you can of both assets in the AMM's pool. |
|
||||
| `tfTwoAsset` | `0x00100000` | `Amount` and `Amount2` | Withdraw both of this AMM's assets, in up to the specified amounts. The actual amounts received maintains the balance of assets in the AMM's pool. |
|
||||
|
||||
The following combinations of fields indicate a **single asset withdrawal**:
|
||||
|
||||
| Flag Name(s) | Flag Value | Fields Specified | Meaning |
|
||||
|-------------------------|--------------|--------------------------|---------|
|
||||
| `tfSingleAsset` | `0x00080000` | `Amount` only | Withdraw exactly the specified amount of one asset, by returning as many LP Tokens as necessary. |
|
||||
| `tfOneAssetWithdrawAll` | `0x00040000` | `Amount` only | Withdraw at least the specified amount of one asset, by returning _all_ of your LP Tokens. Fails if you can't receive at least the specified amount. The specified amount can be 0, meaning the transaction succeeds if it withdraws any positive amount. |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | `Amount` and `LPTokenIn` | Withdraw up to the specified amount of one asset, by returning up to the specified amount of LP Tokens. |
|
||||
| `tfLimitLPToken` | `0x00400000` | `Amount` and `EPrice` | Withdraw up to the specified amount of one asset, but pay no more than the specified effective price in LP Tokens per unit of the asset received. |
|
||||
|
||||
Any other combination of these fields is invalid.
|
||||
|
||||
### Single Asset Withdrawal Fee
|
||||
|
||||
The fee for a single asset withdrawal is calculated to be the same as if you had performed a double-asset withdrawal and then used the AMM to trade all of the other asset for the one you are withdrawing. The trading fee applies to the amount you would need to trade for, but not to the rest of the withdrawal.
|
||||
|
||||
<!-- TODO: add a formula and example calculation(s) of single-asset withdrawal fees -->
|
||||
|
||||
|
||||
### AMMWithdraw Flags
|
||||
|
||||
Transactions of the AMMWithdraw type support additional values in the [`Flags` field](transaction-common-fields.html#flags-field), as follows:
|
||||
|
||||
| Flag Name | Hex Value | Decimal Value | Description |
|
||||
|:------------------------|:-------------|:--------------|:----------------------|
|
||||
| `tfLPToken` | `0x00010000` | 65536 | Perform a double-asset withdrawal and receive the specified amount of LP Tokens. |
|
||||
| `tfWithdrawAll` | `0x00020000` | 131072 | Perform a double-asset withdrawal returning all your LP Tokens. |
|
||||
| `tfOneAssetWithdrawAll` | `0x00040000` | 262144 | Perform a single-asset withdrawal returning all of your LP Tokens. |
|
||||
| `tfSingleAsset` | `0x00080000` | 524288 | Perform a single-asset withdrawal with a specified amount of the asset to withdrawal. |
|
||||
| `tfTwoAsset` | `0x00100000` | 1048576 | Perform a double-asset withdrawal with specified amounts of both assets. |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | 2097152 | Perform a single-asset withdrawal and receive the specified amount of LP Tokens. |
|
||||
| `tfLimitLPToken` | `0x00400000` | 4194304 | Perform a single-asset withdrawal with a specified effective price. |
|
||||
|
||||
You must specify **exactly one** of these flags, in addition to any [global flags](transaction-common-fields.html#global-flags).
|
||||
|
||||
|
||||
## Error Cases
|
||||
|
||||
In addition to errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:-------------------------|:---------------------------------------------|
|
||||
| `tecFROZEN` | The transaction tried to deposit a [frozen](freezes.html) token. |
|
||||
| `tecAMM_BALANCE` | The transaction would withdraw all of one asset from the pool, or rounding would cause a "withdraw all" to leave a nonzero amount behind. |
|
||||
| `tecAMM_FAILED_WITHDRAW` | The conditions on the withdrawal could not be satisfied; for example, the requested effective price in the `EPrice` field is too low. |
|
||||
| `tecAMM_INVALID_TOKENS` | The AMM for this token pair does not exist, or one of the calculations resulted in a withdrawal amount rounding to zero. |
|
||||
| `tecINSUF_RESERVE_LINE` | The sender of this transaction does meet the increased [reserve requirement](reserves.html) of processing this transaction, probably because they need at least one new trust line to hold one of the assets to be withdrawn, and they don't have enough XRP to meet the additional owner reserve for a new trust line. |
|
||||
| `tecNO_AUTH` | The sender is not authorized to hold one of the deposit assets. |
|
||||
| `temBAD_AMM_OPTIONS` | The transaction specified an invalid combination of fields. See [AMMWithdraw Modes](#ammwithdraw-modes). |
|
||||
| `temBAD_AMM_TOKENS` | The transaction specified the LP Tokens incorrectly; for example, the `issuer` is not the AMM's associated AccountRoot address or the `currency` is not the currency code for this AMM's LP Tokens, or the transaction specified this AMM's LP Tokens in one of the asset fields. |
|
||||
| `terNO_AMM` | The Automated Market Maker instance for the asset pair in this transaction does not exist. |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -190,6 +190,8 @@ targets:
|
||||
"nftoken.html#nftoken-flags": "nftoken.html#nftoken-フラグ"
|
||||
"basic-data-types.html#addresses": "basic-data-types.html#アドレス"
|
||||
"nftokenoffer.html#nftokenoffer-flags": "nftokenoffer.html#nftokenoffer-フラグ"
|
||||
# Fix links from untranslated AMM pages:
|
||||
"transaction-common-fields.html#global-flags": "transaction-common-fields.html#グローバルフラグ"
|
||||
|
||||
pages:
|
||||
|
||||
@@ -2245,6 +2247,7 @@ pages:
|
||||
targets:
|
||||
- en
|
||||
|
||||
# TODO: update translation with new section from the English version
|
||||
- md: references/protocol-reference/ledger-data/ledger-object-types/accountroot.ja.md
|
||||
targets:
|
||||
- ja
|
||||
@@ -2257,6 +2260,11 @@ pages:
|
||||
targets:
|
||||
- ja
|
||||
|
||||
- md: references/protocol-reference/ledger-data/ledger-object-types/amm.md
|
||||
targets:
|
||||
- en
|
||||
- ja
|
||||
|
||||
- md: references/protocol-reference/ledger-data/ledger-object-types/check.md
|
||||
targets:
|
||||
- en
|
||||
@@ -2407,6 +2415,31 @@ pages:
|
||||
targets:
|
||||
- ja
|
||||
|
||||
- md: references/protocol-reference/transactions/transaction-types/ammbid.md
|
||||
targets:
|
||||
- en
|
||||
- ja
|
||||
|
||||
- md: references/protocol-reference/transactions/transaction-types/ammcreate.md
|
||||
targets:
|
||||
- en
|
||||
- ja
|
||||
|
||||
- md: references/protocol-reference/transactions/transaction-types/ammdeposit.md
|
||||
targets:
|
||||
- en
|
||||
- ja
|
||||
|
||||
- md: references/protocol-reference/transactions/transaction-types/ammvote.md
|
||||
targets:
|
||||
- en
|
||||
- ja
|
||||
|
||||
- md: references/protocol-reference/transactions/transaction-types/ammwithdraw.md
|
||||
targets:
|
||||
- en
|
||||
- ja
|
||||
|
||||
- md: references/protocol-reference/transactions/transaction-types/checkcancel.md
|
||||
targets:
|
||||
- en
|
||||
@@ -2690,6 +2723,7 @@ pages:
|
||||
targets:
|
||||
- en
|
||||
|
||||
# TODO: update translation with new/updated sections from the English version
|
||||
- md: references/protocol-reference/serialization.ja.md
|
||||
targets:
|
||||
- ja
|
||||
@@ -3084,6 +3118,12 @@ pages:
|
||||
targets:
|
||||
- ja
|
||||
|
||||
- md: references/http-websocket-apis/public-api-methods/path-and-order-book-methods/amm_info.md
|
||||
targets:
|
||||
- en
|
||||
- ja
|
||||
|
||||
|
||||
- md: references/http-websocket-apis/public-api-methods/path-and-order-book-methods/book_offers.md
|
||||
targets:
|
||||
- en
|
||||
@@ -3713,6 +3753,28 @@ pages:
|
||||
targets:
|
||||
- ja
|
||||
|
||||
- name: AMM
|
||||
html: label-amm.html
|
||||
parent: by-label.html
|
||||
landing_for: AMM
|
||||
template: pagetype-label.html.jinja
|
||||
blurb: Pages relating to Automated Market Makers (AMM).
|
||||
filters:
|
||||
- labels
|
||||
targets:
|
||||
- en
|
||||
|
||||
- name: AMM
|
||||
html: label-amm.html
|
||||
parent: by-label.html
|
||||
landing_for: AMM
|
||||
template: pagetype-label.html.jinja
|
||||
blurb: 自動マーケットメーカー(AMM)に関するページ。
|
||||
filters:
|
||||
- labels
|
||||
targets:
|
||||
- ja
|
||||
|
||||
- name: Blockchain
|
||||
html: label-blockchain.html
|
||||
parent: by-label.html
|
||||
|
||||
81
img/amm-single-asset-deposit-formula.svg
Normal file
81
img/amm-single-asset-deposit-formula.svg
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
|
||||
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
|
||||
<svg fill-opacity="1" xmlns:xlink="http://www.w3.org/1999/xlink" color-rendering="auto" color-interpolation="auto" text-rendering="auto" stroke="black" stroke-linecap="square" width="380" stroke-miterlimit="10" shape-rendering="auto" stroke-opacity="1" fill="black" stroke-dasharray="none" font-weight="normal" stroke-width="1" viewBox="70 100 380 120" height="120" xmlns="http://www.w3.org/2000/svg" font-family="'Dialog'" font-style="normal" stroke-linejoin="miter" font-size="12px" stroke-dashoffset="0" image-rendering="auto"
|
||||
><!--Generated by the Batik Graphics2D SVG Generator--><defs id="genericDefs"
|
||||
/><g
|
||||
><defs id="defs1"
|
||||
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath1"
|
||||
><path d="M0 0 L2147483647 0 L2147483647 2147483647 L0 2147483647 L0 0 Z"
|
||||
/></clipPath
|
||||
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath2"
|
||||
><path d="M0 0 L0 30 L40 30 L40 0 Z"
|
||||
/></clipPath
|
||||
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath3"
|
||||
><path d="M0 0 L0 20 L160 20 L160 0 Z"
|
||||
/></clipPath
|
||||
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath4"
|
||||
><path d="M0 0 L0 30 L30 30 L30 0 Z"
|
||||
/></clipPath
|
||||
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath5"
|
||||
><path d="M0 0 L0 80 L40 80 L40 0 Z"
|
||||
/></clipPath
|
||||
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath6"
|
||||
><path d="M0 0 L0 70 L40 70 L40 0 Z"
|
||||
/></clipPath
|
||||
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath7"
|
||||
><path d="M0 0 L0 50 L40 50 L40 0 Z"
|
||||
/></clipPath
|
||||
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath8"
|
||||
><path d="M0 0 L0 30 L70 30 L70 0 Z"
|
||||
/></clipPath
|
||||
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath9"
|
||||
><path d="M0 0 L0 30 L180 30 L180 0 Z"
|
||||
/></clipPath
|
||||
></defs
|
||||
><g font-family="sans-serif" font-size="14px" transform="translate(170,150)"
|
||||
><text x="5" xml:space="preserve" y="18.1094" clip-path="url(#clipPath2)" stroke="none"
|
||||
>1 +</text
|
||||
></g
|
||||
><g font-family="sans-serif" font-size="14px" transform="translate(200,140)"
|
||||
><text x="5" xml:space="preserve" y="18.1094" clip-path="url(#clipPath3)" stroke="none"
|
||||
>B - (F × (1 - W) × B)</text
|
||||
></g
|
||||
><g font-family="sans-serif" font-size="14px" transform="translate(260,160)"
|
||||
><text x="5" xml:space="preserve" y="18.1094" clip-path="url(#clipPath4)" stroke="none"
|
||||
>P</text
|
||||
></g
|
||||
><g font-family="sans-serif" font-size="60px" transform="translate(390,120)"
|
||||
><text x="5" xml:space="preserve" y="61.2188" clip-path="url(#clipPath5)" stroke="none"
|
||||
>]</text
|
||||
></g
|
||||
><g font-family="sans-serif" font-size="60px" transform="translate(150,120)"
|
||||
><text x="5" xml:space="preserve" y="61.2188" clip-path="url(#clipPath6)" stroke="none"
|
||||
>[</text
|
||||
></g
|
||||
><g font-family="sans-serif" font-size="40px" transform="translate(340,130)"
|
||||
><text x="5" xml:space="preserve" y="42.4844" clip-path="url(#clipPath7)" stroke="none"
|
||||
>)</text
|
||||
></g
|
||||
><g font-family="sans-serif" font-size="40px" transform="translate(160,130)"
|
||||
><text x="5" xml:space="preserve" y="42.4844" clip-path="url(#clipPath7)" stroke="none"
|
||||
>(</text
|
||||
></g
|
||||
><g font-family="sans-serif" font-size="14px" transform="translate(350,130)"
|
||||
><text x="5" xml:space="preserve" y="18.1094" clip-path="url(#clipPath4)" stroke="none"
|
||||
>W</text
|
||||
></g
|
||||
><g font-family="sans-serif" font-size="14px" transform="translate(370,150)"
|
||||
><text x="5" xml:space="preserve" y="18.1094" clip-path="url(#clipPath4)" stroke="none"
|
||||
>- 1</text
|
||||
></g
|
||||
><g font-family="sans-serif" font-size="14px" transform="translate(90,150)"
|
||||
><text x="5" xml:space="preserve" y="18.1094" clip-path="url(#clipPath8)" stroke="none"
|
||||
>L = T ×</text
|
||||
></g
|
||||
><g transform="translate(190,150)"
|
||||
><path fill="none" d="M10.5 10.5 L160.5 10.5" clip-path="url(#clipPath9)"
|
||||
/></g
|
||||
></g
|
||||
></svg
|
||||
>
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
@@ -334,6 +334,7 @@
|
||||
|
||||
&.label-accounts,
|
||||
&.label-payment-channels,
|
||||
&.label-amm,
|
||||
&.label-アカウント,
|
||||
&.label-payment-channel,
|
||||
&.chip-indigo {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
"node-sass": "^7.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build-css": "node-sass --include-path scss xrpl.scss ../assets/css/devportal2022-v11b.css --output-style compressed",
|
||||
"build-css-out": "node-sass --include-path scss xrpl.scss ../out/assets/css/devportal2022-v11b.css --output-style compressed --source-map true",
|
||||
"build-css-watch-out": "node-sass --recursive --watch --include-path scss xrpl.scss ../out/assets/css/devportal2022-v11b.css --output-style compressed --source-map true"
|
||||
"build-css": "node-sass --include-path scss xrpl.scss ../assets/css/devportal2022-v12.css --output-style compressed",
|
||||
"build-css-out": "node-sass --include-path scss xrpl.scss ../out/assets/css/devportal2022-v12.css --output-style compressed --source-map true",
|
||||
"build-css-watch-out": "node-sass --recursive --watch --include-path scss xrpl.scss ../out/assets/css/devportal2022-v12.css --output-style compressed --source-map true"
|
||||
},
|
||||
"dependencies": {
|
||||
"sass": "^1.26.10"
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
{% if target.lang=="ja" %}
|
||||
<link href="{{currentpage.prefix}}assets/css/fonts-ja.css" rel="stylesheet" />
|
||||
{% endif %}
|
||||
<link href="{{currentpage.prefix}}assets/css/devportal2022-v11b.css" rel="stylesheet" />
|
||||
<link href="{{currentpage.prefix}}assets/css/devportal2022-v12.css" rel="stylesheet" />
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user