This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ mdformat | |
mosquitto | ||
mqtt | ||
mqttoptions | ||
mypools | ||
noqa | ||
notif | ||
pgrep | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CREATE INDEX inbox_events_mypools ON inbox_events ( | ||
(data ->> 'provider') | ||
) WHERE event_name = 'emojicoin_dot_fun::Liquidity' AND (data ->> 'liquidity_provided')::BOOLEAN = true; | ||
|
||
-- noqa: disable=PRS | ||
CREATE FUNCTION mypools (address text) RETURNS TABLE (LIKE market_data) AS | ||
$$ | ||
WITH mypools AS ( | ||
SELECT DISTINCT (data ->> 'market_id')::NUMERIC AS market_id | ||
FROM inbox_events | ||
WHERE event_name = 'emojicoin_dot_fun::Liquidity' | ||
AND (data ->> 'liquidity_provided')::BOOLEAN = true | ||
AND (data ->> 'provider') = $1 | ||
) | ||
SELECT m.* FROM market_data m INNER JOIN mypools p ON m.market_id = p.market_id; | ||
$$ LANGUAGE SQL; |