Merge pull request #1781 from develoQ/japanese-amm

[JA] AMM
This commit is contained in:
Rome Reginelli
2023-03-09 16:20:40 -08:00
committed by GitHub
15 changed files with 1077 additions and 62 deletions

View File

@@ -7,7 +7,7 @@ labels:
- XRP
---
# AccountRoot
[[ソース]](https://github.com/ripple/rippled/blob/5d2d88209f1732a0f8d592012094e345cbe3e675/src/ripple/protocol/impl/LedgerFormats.cpp#L27 "Source")
[[ソース]](https://github.com/xrplf/rippled/blob/5d2d88209f1732a0f8d592012094e345cbe3e675/src/ripple/protocol/impl/LedgerFormats.cpp#L27 "Source")
`AccountRoot`オブジェクトタイプは、1つの[アカウント](accounts.html)、そのアカウントの設定、XRP残高を記述します。
@@ -36,41 +36,29 @@ labels:
`AccountRoot`オブジェクトのフィールドは次のとおりです。
| フィールド | JSONの型 | [内部の型][] | 説明 |
|:------------------------------|:----------|:------------------|:-------------|
| `LedgerEntryType` | 文字列 | UInt16 | `0x0061`が文字列`AccountRoot`にマッピングされている場合は、これがAccountRootオブジェクトであることを示します。 |
| `Account` | 文字列 | AccountID | このアカウントの識別用アドレスrf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpnなど。 |
| `Balance` | 文字列 | Amount | アカウントの現在の[drop単位のXRP残高][XRP、drop単位]で、文字列で表現されます。 |
| [`Flags`](#accountrootのフラグ) | 数値 | UInt32 | このアカウントに対して有効になっているブールフラグのビットマップ。 |
| `OwnerCount` | 数値 | UInt32 | レジャーでこのアカウントが所有しており、アカウント所有者の準備金に資金を付与するオブジェクトの数。 |
| `PreviousTxnID` | 文字列 | Hash256 | 最後にこのオブジェクトを変更したトランザクションの識別用ハッシュ。 |
| `PreviousTxnLgrSeq` | 数値 | UInt32 | 最後にこのオブジェクトを変更したトランザクションが記録された[レジャーインデックス][]。 |
| `Sequence` | 数値 | UInt32 | このアカウントの次に有効なトランザクションのシーケンス番号。各アカウントはSequence = 1で開始し、トランザクションが作られるたびにこの値が増加します。 |
| `AccountTxnID` | 文字列 | Hash256 | _省略可_ このアカウントが最後に送信したトランザクションの識別用ハッシュ。 |
| `Domain` | 文字列 | VariableLength | _省略可_ このアカウントに関連付けられているドメイン。JSONではこれはドメインのASCII表現の16進数値です。 |
| `EmailHash` | 文字列 | Hash128 | _省略可_ メールアドレスのmd5ハッシュ。クライアントはこれを使用してサービス内で[Gravatar](https://en.gravatar.com/)などのアバターを検索できます。 |
| `MessageKey` | 文字列 | VariableLength | _省略可_ 暗号化メッセージをこのアカウントに送信するときに使用できる公開鍵。JSONでは16進数値を使用します。33バイト以下です。 |
| `RegularKey` | 文字列 | AccountID | _省略可_ このアカウントのトランザクションに署名するときにマスターキーの代わりに使用できる[キーペア](cryptographic-keys.html)のアドレス。この値を変更するには[SetRegularKeyトランザクション][]を使用してください。 |
| `TickSize` | 数値 | UInt8 | _省略可_ このアドレスが発行した通貨が関わるオファーの為替レートに使用する有効桁数。有効な値は`3`以上`15`以下です。_[TickSize Amendment][]が必要です。_ |
| `TransferRate` | 数値 | UInt32 | _省略可_ このアカウントが発行した通貨を他のユーザーが相互に送金する際に、これらのユーザーに請求する[送金手数料](transfer-fees.html)。 |
| `WalletLocator` | 文字列 | Hash256 | _省略可_ **廃止予定**。使用しないでください。 |
| `WalletSize` | 数値 | UInt32 | _省略可_ **廃止予定**。使用しないでください。 |
## Special AMM AccountRoot Objects
<!-- TODO: translate this section -->
{% include '_snippets/amm-disclaimer.md' %}
[Automated Market Makers](automated-market-makers.html) (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.
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|:------------------------------|:---------|:------------------|:-------------|
| `Account` | 文字列 | AccountID | はい | この[アカウント](accounts.html)を識別するための(クラシック)アドレスです。。 |
| `AccountTxnID` | 文字列 | Hash256 | いいえ | このアカウントから直近に送信されたトランザクションの識別ハッシュ。このフィールドは、[`AccountTxnID`トランザクションフィールド](transaction-common-fields.html#accounttxnid)を使うために有効になっていなければなりません。これを有効にするには、[`asfAccountTxnID`フラグを有効にしたAccountSetトランザクション](accountset.html#accountsetのフラグ)を送信してください。 |
| `Balance` | 文字列 | Amount | いいえ | アカウントの現在の[drop単位のXRP残高][XRP、drop単位]で、文字列で表現されます。 |
| `BurnedNFTokens` | 数値 | UInt32 | いいえ | このアカウントで発行された [非代替性トークン](non-fungible-tokens.html) のうち、バーンしたトークンの総数を表します。この数値は常に `MintedNFTokens` と同じかそれ以下となります。 |
| `Domain` | 文字列 | VariableLength | いいえ | このアカウントに関連付けられたドメイン。JSONでは、ドメインのASCII表現を16進数で表現します。[256バイトを超える長さは使用できません](https://github.com/xrplf/rippled/blob/55dc7a252e08a0b02cd5aa39e9b4777af3eafe77/src/ripple/app/tx/impl/SetAccount.h#L34) |
| `EmailHash` | 文字列 | Hash128 | いいえ | メールアドレスのmd5ハッシュ。クライアントはこれを使用してサービス内で[Gravatar](https://ja.gravatar.com/)などのアバターを検索できます。 |
| [`Flags`](#accountrootのフラグ) | 数値 | UInt32 | はい | このアカウントに対して有効になっているブールフラグのビットマップ。 |
| `LedgerEntryType` | 文字列 | UInt16 | はい | 値`0x0061`で文字列`AccountRoot`にマッピングされ、AccountRootオブジェクトであることを示します。 |
| `MessageKey` | 文字列 | VariableLength | いいえ | このアカウントに暗号化されたメッセージを送信するために使用することができる公開鍵です。JSONでは、16進数で指定します。33バイトであることが必要で、最初の1バイトは鍵の種類を表します。secp256k1鍵の場合は`0x02`または`0x03`、Ed25519鍵の場合は`0xED`となります。 |
| `MintedNFTokens` | 数値 | UInt32 | いいえ | このアカウントによって、またはこのアカウントのためにMintされた[非代替性トークン](non-fungible-tokens.html) の合計数。 |
| `NFTokenMinter` | 文字列 | AccountID | いいえ | このアカウントに代わって[非代替性トークン](non-fungible-tokens.html)をミントできる別のアカウントを表します。 |
| `OwnerCount` | 数値 | UInt32 | はい | レジャーでこのアカウントが所有しており、アカウント所有者の準備金に資金を付与するオブジェクトの数。 |
| `PreviousTxnID` | 文字列 | Hash256 | はい | 最後にこのオブジェクトを変更したトランザクションの識別用ハッシュ。 |
| `PreviousTxnLgrSeq` | 数値 | UInt32 | はい | 最後にこのオブジェクトを変更したトランザクションが記録された[レジャーインデックス][]。 |
| `RegularKey` | 文字列 | AccountID | いいえ | このアカウントのトランザクションに署名するときにマスターキーの代わりに使用できる[キーペア](cryptographic-keys.html)のアドレス。この値を変更するには[SetRegularKeyトランザクション][]を使用してください。 |
| `Sequence` | 数値 | UInt32 | はい | このアカウントの有効な次のトランザクションの[シーケンス番号](basic-data-types.html#アカウントシーケンス) を表します。 |
| `TicketCount` | 数値 | UInt32 | いいえ | このアカウントが台帳に保有する[チケット](tickets.html)の数です。これは、アカウントが一度に250 チケットという上限以内に留まることを保証するために自動的に更新されます。このフィールドは、チケットの数がゼロの場合は省略されます。 _([TicketBatch amendment][]によって追加されました)_ |
| `TickSize` | 数値 | UInt8 | いいえ | このアドレスが発行した通貨が関わるオファーの為替レートに使用する有効桁数。有効な値は`3`以上`15`以下です。_[TickSize Amendment][]が必要です。_ |
| `TransferRate` | 数値 | UInt32 | いいえ | このアカウントが発行した通貨を他のユーザーが相互に送金する際に、これらのユーザーに請求する[送金手数料](transfer-fees.html)。 |
| `WalletLocator` | 文字列 | Hash256 | いいえ | ユーザーが設定できる任意の256bit値。 |
| `WalletSize` | 数値 | UInt32 | いいえ | 未使用。(コード上ではこのフィールドをサポートしていますが、設定する方法はありません)。 |
## AccountRootのフラグ
@@ -78,17 +66,33 @@ In most other ways, these accounts function like ordinary accounts; the LP Token
AccountRootオブジェクトには以下のフラグ値を指定できます。
| フラグ名 | 16進数値 | 10進数値 | 説明 | 対応する[AccountSetのフラグ](accountset.html#accountsetのフラグ) |
|-----------|-----------|---------------|-------------|-------------------------------|
| lsfDefaultRipple | 0x00800000 | 8388608 | このアドレスのトラストラインでデフォルトで[rippling](rippling.html)を有効にします。発行アドレスに必要です。他のアドレスでの使用は推奨されません。 | asfDefaultRipple |
| lsfDepositAuth | 0x01000000 | 16777216 | このアカウントは、アカウントが送信するトランザクションと、[事前承認された](depositauth.html#事前承認)アカウントからの資金だけを受領します。([DepositAuth](depositauth.html)有効になっています。) | asfDepositAuth |
| lsfDisableMaster | 0x00100000 | 1048576 | このアカウントのトランザクションの署名にマスターキーを使用することを禁止します。 | asfDisableMaster |
| lsfDisallowXRP | 0x00080000 | 524288 | クライアントアプリケーションはこのアカウントにXRPを送金しないでください。`rippled`により強制されるものではありません。 | asfDisallowXRP |
| lsfGlobalFreeze | 0x00400000 | 4194304 | このアドレスが発行するすべての資産が凍結されます。 | asfGlobalFreeze |
| lsfNoFreeze | 0x00200000 | 2097152 | このアドレスは、このアドレスに接続しているトラストラインを凍結できません。一度有効にすると、無効にできません。 | asfNoFreeze |
| lsfPasswordSpent | 0x00010000 | 65536 | このアカウントは無料のSetRegularKeyトランザクションを使用しています。 | (なし) |
| lsfRequireAuth | 0x00040000 | 262144 | このアカウントは、他のユーザーがこのアカウントのイシュアンスを保有することを個別に承認する必要があります。 | asfRequireAuth |
| lsfRequireDestTag | 0x00020000 | 131072 | 受信ペイメントには宛先タグの指定が必要です。 | asfRequireDest |
| フラグ名 | 16進数値 | 10進数値 | 対応する[AccountSetのフラグ](accountset.html#accountsetのフラグ) | 説明 |
|---------------------|--------------|----------|---------------|-------------------------------|
| `lsfAMM`:not_enabled: | `0x00010000` | 33554432 | (なし) | このアカウントは、自動マーケットメーカーのインスタンスです。:not_enabled: |
| `lsfDefaultRipple` | `0x00800000` | 8388608 | `asfDefaultRipple` | このアドレスのトラストラインでデフォルトで[rippling](rippling.html)有効にします。発行アドレスに必要です。他のアドレスでの使用は推奨されません。 |
| `lsfDepositAuth` | `0x01000000` | 16777216 | `asfDepositAuth` | このアカウントは、アカウントが送信するトランザクションと、[事前承認された](depositauth.html#事前承認)アカウントからの資金だけを受領します。([DepositAuth](depositauth.html)が有効になっています。) |
| `lsfDisableMaster` | `0x00100000` | 1048576 | `asfDisableMaster` | このアカウントのトランザクションの署名にマスターキーを使用することを禁止します。 |
| `lsfDisallowXRP` | `0x00080000` | 524288 | `asfDisallowXRP` | クライアントアプリケーションはこのアカウントにXRPを送金しないでください。`rippled`により強制されるものではありません。 |
| `lsfGlobalFreeze` | `0x00400000` | 4194304 | `asfGlobalFreeze` | このアドレスが発行するすべての資産が凍結されます。 |
| `lsfNoFreeze` | `0x00200000` | 2097152 | `asfNoFreeze` | このアドレスは、このアドレスに接続しているトラストラインを凍結できません。一度有効にすると、無効にできません。 |
| `lsfPasswordSpent` | `0x00010000` | 65536 | (なし) | このアカウントは無料のSetRegularKeyトランザクションを使用しています。 |
| `lsfRequireAuth` | `0x00040000` | 262144 | `asfRequireAuth` | このアカウントは、他のユーザーがこのアカウントのトークンを保有することを個別に承認する必要があります。 |
| `lsfRequireDestTag` | `0x00020000` | 131072 | `asfRequireDest` | 受信ペイメントには宛先タグの指定が必要です。 |
## AMMの特殊なAccountRootオブジェクト
{% include '_snippets/amm-disclaimer.ja.md' %}
[自動マーケットメーカー](automated-market-makers.html) (AMM) は、AMMの詳細の一部を追跡するための[AMMオブジェクト][]に加えて、LPトークンを発行しAMMプール内の資産を保持するためにAccountRootオブジェクトを使用します。AMMに関連するAccountRootのアドレスは、AMMが作成される前にユーザーがそのアドレスを特定し資金を提供できないように、ランダム化されています。AMMのAccountRootは、通常のアカウントとは異なり、以下のような設定で作成されます。
- `lsfAMM` **有効** : これは、AccountRootがAMMの一部であり、通常のアカウントでないことを示します。
- `lsfDisableMaster` **有効** : トランザクションへ署名する手段はありません。これにより、誰もそのアカウントを直接操作することができず、トランザクションを送信することができなくなります。
- `lsfRequireAuth` **有効** : 事前承認されているアカウントは存在しません。これにより、AMMアカウントに資産を追加する唯一の方法は、[AMMDepositトランザクション][]を使用することであることが保証されます。
- `lsfDefaultRipple` **有効** : ユーザー間でAMMのLPトークンを送信したり、取引したりすることが可能になります。
これらの特殊なアカウントは、[準備金要件](reserves.html)の対象外ですが、AMMのプール内の2つの資産のうちの1つであれば、XRPを保有することができます。
LPトークンは他の[トークン](tokens.html)と同様に動作しますが、これらのトークンはAMM関連のトランザクションでも使用することができます。AMMの残高や、AMMに影響を与えたトランザクションの履歴は、通常のアカウントと同じように確認することができます。
## AccountRoot IDのフォーマット

View File

@@ -7,7 +7,7 @@ labels:
- XRP
---
# AccountRoot
[[Source]](https://github.com/ripple/rippled/blob/5d2d88209f1732a0f8d592012094e345cbe3e675/src/ripple/protocol/impl/LedgerFormats.cpp#L27 "Source")
[[Source]](https://github.com/xrplf/rippled/blob/5d2d88209f1732a0f8d592012094e345cbe3e675/src/ripple/protocol/impl/LedgerFormats.cpp#L27 "Source")
The `AccountRoot` object type describes a single [account](accounts.html), its settings, and XRP balance.
@@ -42,7 +42,7 @@ The `AccountRoot` object has the following fields:
| `AccountTxnID` | String | Hash256 | No | The identifying hash of the transaction most recently sent by this account. This field must be enabled to use the [`AccountTxnID` transaction field](transaction-common-fields.html#accounttxnid). To enable it, send an [AccountSet transaction with the `asfAccountTxnID` flag enabled](accountset.html#accountset-flags). |
| `Balance` | String | Amount | No | The account's current [XRP balance in drops][XRP, in drops], represented as a string. |
| `BurnedNFTokens` | Number | UInt32 | No | How many total of this account's issued [non-fungible tokens](non-fungible-tokens.html) have been burned. This number is always equal or less than `MintedNFTokens`. |
| `Domain` | String | Blob | No | A domain associated with this account. In JSON, this is the hexadecimal for the ASCII representation of the domain. [Cannot be more than 256 bytes in length.](https://github.com/ripple/rippled/blob/55dc7a252e08a0b02cd5aa39e9b4777af3eafe77/src/ripple/app/tx/impl/SetAccount.h#L34) |
| `Domain` | String | Blob | No | A domain associated with this account. In JSON, this is the hexadecimal for the ASCII representation of the domain. [Cannot be more than 256 bytes in length.](https://github.com/xrplf/rippled/blob/55dc7a252e08a0b02cd5aa39e9b4777af3eafe77/src/ripple/app/tx/impl/SetAccount.h#L34) |
| `EmailHash` | String | Hash128 | No | The md5 hash of an email address. Clients can use this to look up an avatar through services such as [Gravatar](https://en.gravatar.com/). |
| [`Flags`](#accountroot-flags) | Number | UInt32 | Yes | A bit-map of boolean flags enabled for this account. |
| `LedgerEntryType` | String | UInt16 | Yes | The value `0x0061`, mapped to the string `AccountRoot`, indicates that this is an AccountRoot object. |

View File

@@ -0,0 +1,116 @@
---
html: amm.html
parent: ledger-object-types.html
blurb: 自動マーケットメーカーAMMインスタンスの定義と詳細。
labels:
- AMM
status: not_enabled
---
# AMM
[[Source]](https://github.com/xrplf/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.ja.md' %}
`AMM`オブジェクトは、単一の[自動マーケットメーカー](automated-market-makers.html)(AMM)インスタンスを表します。
## 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 フィールド
`AMM`オブジェクトは以下のフィールドを持ちます。
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|:-----------------|:--------------------|:------------------|:----------|--------------|
| `Asset` | オブジェクト | STIssue | はい | このAMMが保有する2つのアセットのうちの1つの定義。JSONでは、`currency``issuer`フィールドを持つオブジェクトになります。 |
| `Asset2` | オブジェクト | STIssue | はい | このAMMが保有するもう一つの資産の定義。JSONでは、`currency``issuer`フィールドを持つオブジェクトになります。 |
| `AMMAccount` | 文字列 | AccountID | はい | このAMMの資産を保有する[特殊なアカウント](accountroot.html#ammの特殊なaccountrootオブジェクト)のアドレス。 |
| `AuctionSlot` | オブジェクト | STObject | いいえ | オークションスロットの現在の所有者の詳細。[オークションスロットオブジェクト](#オークションスロットオブジェクト)形式です。|
| `LPTokenBalance` | [通貨額][] | Amount | はい | AMMインスタンスの流動性供給者トークンの発行残高の合計。このトークンの保有者は、保有量に比例してAMMの取引手数料に投票したり、取引手数料の徴収とともに増えていくAMMの資産の一部とトークンを交換したりすることができます。 |
| `TradingFee` | 数値 | UInt16 | はい | AMMインスタンスに対する取引に課される手数料のパーセンテージを1/100,000の単位で指定します。最大値は1000で、これは1%の手数料となります。 |
| `VoteSlots` | 配列 | STArray | いいえ | プールの取引手数料に関する投票を表す、投票オブジェクトのリスト。|
### オークションスロットオブジェクト
`AuctionSlot`フィールドは、以下のネストしたフィールドを持つオブジェクトを含んでいます。
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|:----------------|:--------------------|:------------------|:----------|:--|
| `Account` | 文字列 - アドレス | AccountID | はい | このオークションスロットの現在の所有者。 |
| `AuthAccounts` | 配列 | STArray | いいえ | AMMインスタンスに対して取引手数料を割引した価格で取引することを許可された、最大4つの追加アカウントのリスト。 |
| `DiscountedFee` | 文字列 | UInt32 | はい | オークションの所有者に請求される取引手数料で、`TradingFee`と同じフォーマットです。デフォルトでは0で、オークションスロットの所有者はAMMの標準的な手数料の代わりに、手数料なしで取引できることを意味します。 |
| `Price` | [通貨額][] | Amount | はい | オークションスロットの所有者がこのスロットを落札するために支払った金額LPトークン。 |
| `Expiration` | 文字列 | UInt32 | はい | このスロットの有効期限が切れる[Rippleエポック以降の経過秒数][]で指定した時刻。 |
## AMM フラグ
現在、`AMM`オブジェクトに定義されているフラグはありません。
## AMM ID フォーマット
`AMM`オブジェクトのIIは、以下の値の[SHA-512Half][]を順に繋げたものです。
1. `AMM`のスペースキー(`0x0041`)
0. 第1アセットの発行者のAccountID。
0. 第1トークンの160ビットの通貨コード。
0. 第2アセットの発行者のAccountID。
0. 第2トークンの160ビットの通貨コード。
XRPの場合、トークン・発行者ともに全て0を使用します。
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}