Market Halting #336
dangell7
started this conversation in
Ideas (pre standard proposal)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Market Halting
Abstract
This amendment introduces regulatory compliance capabilities for halting market trading activities on private XRPL-based blockchains. It provides mechanisms to halt trading for specific assets either in specific domains or across all domains, while preserving the functionality of non-trading transactions such as payments, checks, and escrows.
The amendment operates independently and affects DEX activity across open DEX and permissioned domains, providing granular control for token issuers.
Amendment
The proposed amendment introduces efficient halting mechanisms for market trading using asset-specific and domain-specific ledger entries, providing token issuers with the ability to temporarily suspend trading of their assets while maintaining other blockchain functionalities.
The amendment adds:
New Ledger Entry Types
0x0086
): Represents halt state for a specific asset in a specific domain.New Serialized Fields
UInt32
, code55
): Timestamp when the halt was initiated.New Transaction Types
ttMARKET_HALT
, code66
): Halts or unhalts market trading for specific assets.New Transaction Flags
For MarketHalt Transactions
0x00010000
): Indicates intent to halt/unhalt specific asset.0x00020000
): When combined withtfAssetHalt
, indicates halt should apply to all domains.tfMarketHaltMask = ~(tfUniversal | tfAssetHalt | tfAllDomains)
Flag Combinations:
tfAssetHalt
onlytfAssetHalt | tfAllDomains
Note: The transaction toggles the halt state of the target asset.
Market Activity Definition
For the purposes of this amendment:
OfferCreate
, cross-currencyPayment
) in any domain (open DEX, permissioned domains, AMMs)DomainID
withtfAssetHalt
only)tfAllDomains
flag set)Ledger Object Types
New Ledger Object:
MarketHalt
The
MarketHalt
ledger entry represents halt state for a specific asset in a specific domain.Object ID
The ID of a
MarketHalt
entry is generated using:Halt Types:
keylet::marketHalt(asset, domainID)
withFlags
unsetkeylet::marketHalt(asset, domainID)
withlsfAllDomains
flag setFields
MarketHalt
0x0086
).Flags
Asset
DomainID
HaltTimestamp
Account
MarketHalt Flags
lsfAllDomains
0x00010000
Flag Usage:
Flags = 0
): Halt applies only to the specifiedDomainID
Flags = lsfAllDomains
): Halt applies to all domains for this assetExample
MarketHalt
ObjectsDomain-Specific Asset Halt:
All-Domains Asset Halt:
New Transaction Type
Transaction Type:
MarketHalt
The
MarketHalt
transaction is used to halt or unhalt market trading for specific assets in specific domains or across all domains.Fields
TransactionType
MarketHalt
, value66
).Account
Asset
DomainID
Flags
tfAssetHalt
with optional additional flags.Halt vs Unhalt Logic
The transaction operates as follows:
tfAssetHalt
flag only - affects only the specifiedDomainID
tfAssetHalt | tfAllDomains
flags - affects all domains for this assetThe transaction toggles the halt state of the specified asset.
Authority Requirements
Asset
can halt that specific assetFailure Conditions
The
MarketHalt
transaction MUST fail if:tfAssetHalt
flag is not set.Asset
field is missing or invalid.Asset
.DomainID
is specified, the domain must exist.tfAllDomains
flag is set withouttfAssetHalt
flag.State Changes
If the transaction is successful:
MarketHalt
object for the specified Asset/DomainID is created, updated, or removed.tfAssetHalt
)lsfAllDomains
flag is set on the ledger object.Example Transactions
Modified Transaction Processing
OfferCreate
Transaction ChangesWhen processing an
OfferCreate
transaction, the transaction MUST fail withtecMARKET_HALTED
if:MarketHalt
with matching asset andlsfAllDomains
flag set, ORMarketHalt
with matching asset and matchingDomainID
Cross-Currency
Payment
Transaction ChangesWhen processing a
Payment
transaction that involves currency conversion, the transaction MUST fail withtecMARKET_HALTED
if:Any asset in the payment path has a halt (applying same logic as offers - check all-domains halts first, then domain-specific halts)
Unaffected Transactions
The following transactions are NOT affected by market halts:
Payment
transactions without currency conversion (direct payments)Check
transactions (CheckCreate, CheckCash, CheckCancel)Escrow
transactionsPaymentChannel
transactionsNote: AMM transactions may be included in future versions of this amendment.
Efficient Halt Checking Implementation
DEX Transaction Processing Logic
When processing
OfferCreate
or cross-currencyPayment
transactions, the implementation must perform efficient halt checks:Asset Halt Check (O(1) operation)
Check Logic
This approach ensures:
RPC Changes
New RPC Method:
market_state
Returns the current state of market halts.
Request Format
Response Format
Modified RPC Methods
The following existing RPC methods will return appropriate error responses when querying halted assets:
book_offers
: ReturnsrpcMARKET_HALTED
error for halted assetspath_find
: Excludes halted assets from path calculationsripple_path_find
: Excludes halted assets from path calculationsError Codes
New Transaction Error Codes
New RPC Error Codes
Security Considerations
Authority Management
Race Conditions
The distributed nature of the XRPL means there may be a brief window where:
tecMARKET_HALTED
This is the intended behavior and provides the guarantee that no offers will be accepted once a halt is in a validated ledger.
Audit Trail
All halt/unhalt activities are permanently recorded in the ledger, providing a complete audit trail for regulatory compliance.
Performance Analysis
Memory Overhead
Processing Overhead
Network Impact
Implementation Notes
Keylet Definitions
Backward Compatibility
This amendment maintains full backward compatibility with:
Examples
Example 1: All-Domains Asset Halt
MarketHalt
withtfAssetHalt | tfAllDomains
flagsExample 2: Domain-Specific Asset Halt
MarketHalt
with GME asset,DomainID=uint256{1234...}
, andtfAssetHalt
flagExample 1: All-Pairs Asset Halt
MarketHalt
with GME asset andtfAssetHalt
flagBeta Was this translation helpful? Give feedback.
All reactions