0073 XLS-73d: AMMClawback #212
Replies: 10 comments 31 replies
-
The way the new
Except it will (presumably) avoid rounding issues. Is this roughly an accurate description? Two questions:
|
Beta Was this translation helpful? Give feedback.
-
Is withdrawing already prohibited? If not, is there a reason why it is not being prohibited in this proposal? |
Beta Was this translation helpful? Give feedback.
-
For such pool, do we need to include a boolean allowClawback in amm_info's response? eg. account_info also includes allowTrustLineClawback |
Beta Was this translation helpful? Give feedback.
-
Is the clawback feature able to be used to prohibit an account that is not on a blacklist but just trying to single deposit Asset “A” which is an asset that anyone can acquire on the XRP Ledger (For example: XRP or RLUSD) into an AMM Pool paired to Asset “B” which is a regulated asset that they are not authorized to acquire or hold? In a hypothetical AMM Pool between RLUSD/TBILL a retail user could actually single deposit RLUSD and gain exposure to 50% of $TBILL which accrues the off-chain T-Bill Yield in its value gradually increasing. This makes the LP Token extremely powerful because It’s effectively a Super Stablecoin that is accruing multi Yield Streams that include the On-Chain AMM FEES, CAM revenue , Harvesting Volatility BUT with the addition of OFF-CHAIN Yield from short term US Treasury T-Bills on 50% of the value LP Tokens which is their ownership share. WoW 🤩These hypothetical LP Tokens are Ultra Pristine COLLATERAL. Perfect to use as collateral to borrower $RLUSD or $XRP creating borrow side demand in a secured DeFi Money Market Protocol on EVM Sidechain. I appreciate your response as it will help the community understand what the possible potential opportunities w we might see built out by Dapp Devs on EVM sidechain utilizing the AMM LP Tokens or in Future on XRPL once supporting amendments are passed and implemented. Thank You to all the brilliant minds who have been rigorously working continuously enhancing and maintaining the XRPL. Including all those individuals and businesses and universities and projects building on XRPL that run critical infrastructure including nodes, validators, and others. The community XRP Ledger Devs, Cryptographers, Mathematicians, Researchers, and Engineers that are executing on Ripple’s brilliant and very ambitious Roadmap for creating the foundation to support RWA Tokenization, Compliance, Identity Verification, and new enhancements to the core ledger or supporting the necessary Final question, can the current XLS-30d AMM SPEC be used with a Stablecoin like RLUSD and an Asset like TBILL tokens that are based on ERC-4626 Vault Contract that gradually but slowly increases the price from the Vault contract distribution of the Yield directly into the the TBILL Token market price, -Mickey B. Fresh “The DeFi Standard" |
Beta Was this translation helpful? Give feedback.
-
Why are we only blocking offer where |
Beta Was this translation helpful? Give feedback.
-
Providing |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Per the new XLS Contributing process, I propose that we can move this discussion to a draft spec: #233 Please comment here if you would like to object to moving this spec/discussion forward in the process into a DRAFT spec. |
Beta Was this translation helpful? Give feedback.
-
Related to a previous question, what's the behavior of AMMClawback transaction against a Holder in an AMM pool where the Holder is only authorized to hold one of the assets from 2 different issuers?
What is the result of the AMMClawback transaction? Under normal circumstances, I understand that 50 FOO would be transferred from the AMM pool to Issuer FOO and 50 BAR would be transferred to HOLDER. But in this scenario, HOLDER is not authorized to hold BAR. As such, I can see a few possible options:
|
Beta Was this translation helpful? Give feedback.
-
Since we had more discussions, I'll check it again: Per the new XLS Contributing process, I propose that we can move this discussion to a draft spec: #233 Please comment here if you would like to object to moving this spec/discussion forward in the process into a DRAFT spec. |
Beta Was this translation helpful? Give feedback.
-
AMMClawback
Abstract
The AMMClawback amendment enables token issuers to claw back tokens from wallets that have deposited into AMM pools, ensuring regulatory compliance. We introduced a new transaction type AMMClawback in this amendment and the AMMClawback transaction is allowed only when
lsfAllowTrustLineClawback
is enabled by the issuer.lsfAllowTrustLineClawback
can be set only if the account has an empty owner directory throughAccountSet
.1. Overview
This proposal introduces new improvements on how AMM interacts with frozen asset and clawback.
1.1. AMM and Frozen Asset
Currently if an asset in the AMM pool is frozen (either global or individual), we can still deposit the paired token into the AMM pool (if the paired asset is not frozen). This proposal introduces:
1.2. AMM and Unauthorized Asset
At present, if an account is not authorized to hold a token in the AMM pool, it can still make a single deposit of the other paired token, provided it is authorized for that token. This proposal introduces:
1.3. AMM and Clawback
Currently, accounts that have enabled clawback cannot create AMM pools. This proposal introduces the following:
lsfAllowTrustLineClawback
. However, token issuers will not be allowed to claw back from the AMM account using theClawback
transaction.AMMClawback
transaction to allow token issuers to exclusively claw back from AMM pools that has one of their tokens, according to the current proportion in the pool.2. Specification
2.1. Prohibiting the Deposit of New Tokens
This proposal introduces changes to the behavior of the
AMMDeposit
transaction when tokens in trustlines interact with Automated Market Maker (AMM) pools.2.1.1. AMMDeposit for Frozen Asset
Assume we have created an Automated Market Maker (AMM) pool with two assets: A and B. Currently, asset A is frozen (either individually or globally). The following table outlines whether specific scenarios are allowed or prohibited for the current behavior and proposed behavior:
As illustrated in the table above, the primary change is that when one asset in the AMM pool is frozen, depositing the other asset is no longer allowed. This means that deposits are prohibited for the non-frozen asset when its paired asset is frozen.
2.1.1. AMMDeposit for Unauthorized Asset
Assume we have created an Automated Market Maker (AMM) pool with two assets: A and B. The issuer of A has set
lsfRequireAuth
and the holder is not authorized to hold A.The table below summarizes the allowed and prohibited scenarios under the current and proposed behavior:
The primary change is that when the holder is not allowed to hold one of the token in the AMM pool, depositing the other asset is no longer allowed.
2.2. Allowing AMM Pool Creation with Clawback-Enabled Tokens
Currently, when clawback is enabled for the issuer account by setting
lsfAllowTrustLineClawback
flag,AMMCreate
is prohibited against this issuer. After the AMMClawback amendment,AMMCreate
is allowed for clawback-enabled issuer. But the issuer can not clawback from the AMM account usingClawback
transaction.AMMClawback
transaction is needed for the issuer to clawback from an AMM account.Example: Illustrating the AMMClawback Amendment
Suppose an issuer has enabled clawback by setting the
lsfAllowTrustLineClawback
flag through anAccountSet
transaction. Additionally, two trustlines have been established between the holder and the issuer for currencies A and BPre-Amendment Behavior:
AMMCreate
) using the pair of trustline assets A and B associated with the issuer, the transaction will fail with atecNO_PERMISSION
error.Post-Amendment Behavior:
AMMCreate
transaction to create an AMM pool with assets A and B, the transaction will be successful.AMMClawback
transaction instead of the regularClawback
transaction.This change allows for the creation of AMM pools with clawback-enabled issuers while introducing a new transaction type (
AMMClawback
) for issuers to clawback assets from AMM accounts.2.3. Introducing a New Transaction for Clawback from AMM Pools
This proposal introduces a new transaction type
AMMClawback
to allow asset issuers to claw back their assets from the AMM pool.Issuers can only claw back issued tokens in the AMM pool only if the
lsfAllowTrustLineClawback
flag is enabled. Attempting to do so without this flag set will result in an error codetecNO_PERMISSION
.By designating the holder account, asset, asset2 and amount, this transaction will:
Asset
's issuer should matchAccount
. Otherwise,temMALFORMED
will be returned.asset
will return to the issuer's account.asset2
which is not issued by the issuer will be transferred back to the holder's account.asset
will return to the issuer's account.tfClawTwoAssets
flag is set, the pairedasset2
which is also issued by the issuer, will return to issuer as well.tfClawTwoAssets
flag is not set, the pairedasset2
will go back to the holder.tfClawTwoAssets
flag can only be set if the issuer issues both assets in the AMM pool. Otherwise,tecNO_PERMISSION
will be returned.2.3.1. Fields for AMMClawback transaction
TransactionType
string
UINT16
TransactionType
specifies the new transaction typeAMMClawback
. The integer value is 31. The recommended name isttAMM_CLAWBACK
.Account
string
ACCOUNT ID
Account
designates the issuer of the asset being clawed back, and must match the account submitting the transaction.Holder
string
ACCOUNT ID
Holder
specifies the holder account of the asset to be clawed back.Asset
object
ISSUE
Asset
specifies the token that the issuer wants to claw back from the AMM pool.Asset
's issuer must match withAccount
. If it does not, the system will return an error:temMALFORMED
. Notice always put the token to be clawed back inAsset
insead ofAsset2
.It has the following subfields:
issuer
currency
Asset2
object
ISSUE
Asset2
specifies the other asset in the AMM pool.It has the following subfields:
issuer
currency
Amount
object
AMOUNT
Amount
specifies the amount of token to be clawed back from the AMM account. It should match theAsset
field.Amount
is not given, all the specified asset will be clawed back.Amount
exceeds the holder's current balance in the AMM pool, all the specified token will be clawed back.It has the following subfields:
issuer
currency
value
2.3.2. Flags
tfClawTwoAssets
Asset
token and the paired tokeAsset2
will be clawed back.Asset
token will be clawed back, and the paired tokenAsset2
will go back to the holder.2.3.3. AMMClawback transaction examples
2.3.3.1 Only one token is issued by the issuer
Assume we have an AMM pool consisting two tokens FOO and Bar. And the proportion of FOO and BAR is 1:2. And the issuer
rPdYxU9dNkbzC5Y2h4jLbVJ3rMRrk7WVRL
only issues FOO, BAR is issued by some other account.rPdYxU9dNkbzC5Y2h4jLbVJ3rMRrk7WVRL
to claw back at most 1000 FOO owned by holderrvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B
from AMM pool FOO/BAR.Account
will be returned to the issuerAccount
. So 1000 FOO will be returned to the issuerrPdYxU9dNkbzC5Y2h4jLbVJ3rMRrk7WVRL
.Amount
is not given or its subfieldvalue
exceeds the holder's available balance, then all the holder's FOO will be clawed back from the AMM pool.tfClawTwoAssets
can not be set because BAR is not issued by the issuer.2.3.3.2 Both tokens are issued by the same issuer
Assume we have an AMM pool consisting two tokens FOO and Bar. And the proportion of FOO and BAR is 1:2. And the issuer
rPdYxU9dNkbzC5Y2h4jLbVJ3rMRrk7WVRL
issues both FOO and BAR.tfClawTwoAssets
is set in theFlags
, so 1000 FOO and 2000 BAR will both go back to the issuer. (IftfClawTwoAssets
is not set in theFlags
, 1000 FOO will go back to the issuer and 2000 BAR will be transferred back to the holder.)Amount
is not given or its subfieldvalue
exceeds the holder's available balance, then we will claw back the holder's existing balance of FOO in the AMM pool. And whether BAR will be clawed back or go back to the holder is still determined by the flagtfClawTwoAssets
.2.3.3.3 Clawback all the tokens
Amount
field.tfClawTwoAssets
is not allowed to be set. All holder's FOO in the AMM pool will be clawed back. And the corresponding BAR will go back to the holder.2.3.3.4 Clawback all the tokens issued by the same issuer
tfClawTwoAssets
is allowed to be set.Amount
is not given andtfClawTwoAssets
is set, the issuer will clawback all the holder's FOO and the corresponding BAR from the AMM pool. (FOO and BAR clawed back amounts reflect the two-asset withdrawal amounts from redeeming all holder's LPtokens in the AMM pool.)tfClawTwoAssets
is used to determine if BAR will be clawed back or goes back to the holder.2.3.3.5 Clawback token from a pool containing XRP
Beta Was this translation helpful? Give feedback.
All reactions