decred.org/dcrdex@v1.0.5/spec/community.mediawiki (about)

     1  =Community Conduct=
     2  
     3  __TOC__
     4  
     5  By registering, clients agree to abide by the rules described here. These rules
     6  are designed to ensure that clients are acting in good faith and maintaining
     7  behaviors that contribute to a smooth DEX experience for other users.
     8  
     9  ==Rules of Community Conduct==
    10  
    11  ===Rule 1: Clients must respond to all preimage requests===
    12  
    13  At the expiration of the epoch, every client with an order will receive a
    14  <code>preimage</code> request. The client has 5 seconds to respond.
    15  
    16  ===Rule 2: Every match must be fully settled===
    17  
    18  Swap transactions must be created at the correct times (see
    19  [[fundamentals.mediawiki/#Exchange_Variables|broadcast timeout]]).
    20  
    21  In the event that the maker fails to start the atomic swap process with their
    22  initialization transaction, the taker will be notified that order execution is
    23  terminated due to failure of the maker to accept the order. The Maker's limit
    24  order will not go back on the order book, but they may be given the option to
    25  replace the order.
    26  
    27  In the event that the taker fails to respond to the maker's initialization
    28  transaction, the maker will incur no violation.
    29  
    30  ===Rule 3: An account's cancellation rate must not exceed the threshold===
    31  
    32  The cancellation rate is the ratio of the count of canceled orders to the
    33  count of all completed orders.
    34  The completed order count is the sum of canceled orders and fully settled
    35  orders.
    36  An order is considered fully settled if it is no longer booked, had at least
    37  one match, and has completed all swaps from matches made with the order.
    38  Failed swaps where the counter-party is at fault do not count against the user.
    39  An order is considered canceled when a cancel order is matched to a standing
    40  limit order. The server may also cancel an order if the client's connection is
    41  dropped and the client fails to reconnect for more than 1 epoch duration.
    42  Cancellation of a partially filled order is counted as a full cancellation.
    43  The cancellation threshold is set by the DEX operator.
    44  The cancellation rate is evaluated on a 100-order rolling window.
    45  
    46  A new user is exempt from the cancellation rate requirement while their
    47  completed order count, <code>total</code>, is not greater than
    48  <code>threshold/(1-threshold)</code>. This follows from the possibility of the
    49  next completed order being fully-settled and just passing the required
    50  cancellation rate threshold: <code>total / (total + 1) <= threshold</code>
    51  
    52  ===Rule 4: Transaction outputs must be properly sized===
    53  
    54  The swap output value must be sized to exactly the matched amount. The fee rate
    55  must be at least the minimum value set by the DEX. It is the client's
    56  responsibility to ensure that fees on a partial fill are not overpaid to a
    57  level that results in a violation of rules 1 or 3 when the remaining portion is
    58  matched.
    59  
    60  ==Penalties==
    61  
    62  The primary penalty for breaches of conduct is a '''ban''', which includes loss
    63  of trading privileges, forfeiture of registration fee, and immediate revocation
    64  of any unfilled orders.
    65  
    66  Less drastic punitive measures such as a cool-down period may be considered
    67  for minor, first-time or infrequent conduct violations.
    68  
    69  ===Penalization Notification===
    70  
    71  In the event that a rule is broken, the client will be sent a notification that
    72  includes penalization details. If the client is offline, this information will
    73  be sent in the [[comm.mediawiki/#Session_Authentication|connect response]].
    74  
    75  '''Notification route:''' <code>penalty</code>, '''originator: ''' DEX
    76  
    77  <code>payload</code>
    78  {|
    79  ! field   !! type   !! description
    80  |-
    81  | penalty || object || a Penalty object (definition below)
    82  |-
    83  | sig     || string || hex-encoded signature of the serialized Penalty object
    84  |}
    85  
    86  ====Penalty Object====
    87  
    88  {|
    89  ! field      !! type   !! description
    90  |-
    91  | brokenrule || int    || the rule that was broken
    92  |-
    93  | timestamp  || int    || the UNIX timestamp in milliseconds at which the penalization occured
    94  |-
    95  | duration   || int    || the duration in milliseconds of the penalization
    96  |-
    97  | details    || string || a message describing the penalization
    98  |}
    99  
   100  '''Penalty serialization'''
   101  
   102  {|
   103  ! field      !! size (bytes) !! description
   104  |-
   105  | brokenrule || 1            || the rule
   106  |-
   107  | timestamp  || 8            || server's UNIX timestamp (milliseconds)
   108  |-
   109  | duration   || 8            || duration (milliseconds)
   110  |-
   111  | details    || string       || a message (UTF-8)
   112  |}