Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Fix query that computes quoter and syncs data on Dune #63

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

harisang
Copy link
Contributor

This PR addresses issue #62, which was caused by a change in our database. Specifically, the order_execution table now only contains entries for limit orders (and NOT market orders).

@harisang harisang requested review from fhenneke and sunce86 January 10, 2024 23:03
Copy link

@sunce86 sunce86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expected to have surplus_fee = 0 for market orders?

@harisang
Copy link
Contributor Author

Is it expected to have surplus_fee = 0 for market orders?

I have to admit I don't remember on the top of my head how exactly is this table used and where, but indeed up till now, all market orders had a zero entry for surplus_fee in the raw_order_rewards table that we were syncing on Dune, which means this was the default behavior.

@fhenneke
Copy link
Contributor

Is it expected to have surplus_fee = 0 for market orders?

At the moment, the surplus fee is only used in one line in the slippage query:

atoms_sold - coalesce(surplus_fee, cast(0 as uint256))        as atoms_sold,

It is used to correct the amount sold for limit orders to follow the same convention as for market orders: the total amount users send is atoms sold + (fee + surplus fee). It already uses a default value of 0, so uploading 0 is a bit redundant.

In the future we might use this entry to upload the total fee (in sell tokens). But it will not be used for anything except monitoring.

@harisang harisang merged commit 8a9e82f into main Jan 11, 2024
4 of 6 checks passed
@harisang harisang deleted the fix_query_that_computes_quoter branch January 11, 2024 13:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants