Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Better Tracking Of Order Trading Metrics #1759

Closed
nlordell opened this issue Mar 27, 2022 · 0 comments
Closed

Better Tracking Of Order Trading Metrics #1759

nlordell opened this issue Mar 27, 2022 · 0 comments
Assignees

Comments

@nlordell
Copy link
Contributor

nlordell commented Mar 27, 2022

Now that we have multiple accounts (PMMs) placing partially fillable liquidity orders, we have seen a sharp decrease in our %orders matched metric:

image

However, it turns out that most of these unmatched orders are just PMMs. If we query the total number of user orders (not matching the configured PMM addresses) as well as how many of those were cancelled and how many of those didn't trade, we see that our numbers are normal:

Order count query since releasing partially fillable orders:
WITH user_orders AS (
        SELECT
                o.*,
                (SELECT COALESCE(COUNT(t.*), 0) FROM trades t WHERE t.order_uid = o.uid) AS trade_count
        FROM orders o
        WHERE o.creation_timestamp >= '2022-03-22'::timestamp
          AND o.owner NOT IN (
                decode('C6093Fd9cc143F9f058938868b2df2daF9A91d28', 'hex'),
                decode('e63A13Eedd01B624958AcFe32145298788a7a7BA', 'hex'),
                decode('16760467FE05bA9B3E97E5f09E6cEaf9B88e9f13', 'hex'),
                decode('91145aa221620b22c4193AF90005ec585072F478', 'hex')
        )
)
SELECT
        COUNT(*) AS total,
        SUM(CASE WHEN cancellation_timestamp IS null THEN 0 ELSE 1 END) AS cancelled,
        SUM(CASE WHEN trade_count=0 THEN 1 ELSE 0 END) AS expired
FROM user_orders;
 total | cancelled | expired 
-------+-----------+---------
  3707 |       142 |     253

This means that we are matching around 90% of orders (which is what we had before the release).

With this in mind, this metric that we collect now is extremely low-signal. This issue captures the work to make this metric actually reflect matched order %.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant