Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Tracking Of Order Trading Metrics #129

Closed
nlordell opened this issue Apr 5, 2022 · 0 comments · Fixed by #167
Closed

Better Tracking Of Order Trading Metrics #129

nlordell opened this issue Apr 5, 2022 · 0 comments · Fixed by #167

Comments

@nlordell
Copy link
Contributor

nlordell commented Apr 5, 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 %.

Original issue gnosis/gp-v2-services#1759 by @nlordell

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

Successfully merging a pull request may close this issue.

1 participant