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

Take the new epoch live #2488

Merged
merged 29 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6c3a510
Modify the aggregate table instead of using the function for tracking…
Jan 10, 2024
2fe13cd
Use aggregated_user_transactions as the new database for the user act…
Jan 10, 2024
d6a3730
Merge pull request #2478 from fluidity-money/develop-make-aggregate-l…
af-afk Jan 10, 2024
c571c8b
Flip the order of the up migration with the lootbottles make table
Jan 10, 2024
aff3599
Experiment with 0 reward tier to see if it renders better in the UI
Jan 10, 2024
4853839
Use the aggregate transactions table for the rewards table
Jan 10, 2024
108bb6c
Remove extraneous logging
Jan 10, 2024
11ccf92
Remove extraneous logging and set the bottle count appropriately
Jan 10, 2024
d902a28
Add back lootbox/reward tier
Jan 10, 2024
76f86b8
Remove some unused imports
Jan 10, 2024
67ab4f7
Merge pull request #2480 from fluidity-money/develop-experiment-with-…
af-afk Jan 10, 2024
574f807
Adjust the links on the page, and update the currently used epoch to …
Jan 10, 2024
6c93d9c
Merge pull request #2481 from fluidity-money/develop-add-links-missin…
af-afk Jan 10, 2024
9a34413
Replace the name from application to ethereum_application
Jan 10, 2024
0feb7c8
Merge pull request #2482 from fluidity-money/develop-change-applicati…
af-afk Jan 10, 2024
b25bc0c
Fix composite key usage
Jan 10, 2024
d225b78
Merge pull request #2483 from fluidity-money/develop-fix-tracked-winn…
af-afk Jan 10, 2024
197347d
Don't display the lootbox icon until we have the information renderin…
Jan 10, 2024
2ca9c65
Remove extraneous logging
Jan 10, 2024
39a9bc9
Remove rewardTier
Jan 10, 2024
8b5a048
Merge pull request #2484 from fluidity-money/develop-fix-tracked-winn…
af-afk Jan 10, 2024
3a58af3
Remove errornous lootbottle from the rewards tab
Jan 11, 2024
9b0bda0
Enclose in text
Jan 11, 2024
3c42f5a
Merge pull request #2485 from fluidity-money/develop-remove-lootbottl…
af-afk Jan 11, 2024
66cea87
Restore the lootbottles to their former glory
Jan 11, 2024
40e1875
Merge pull request #2486 from fluidity-money/develop-remove-lootbottl…
af-afk Jan 11, 2024
8252cfa
Final work to prepare the launch of the airdrop v2
Jan 11, 2024
862b911
Merge pull request #2479 from fluidity-money/develop-flip-user-transa…
af-afk Jan 11, 2024
ca3c2b9
Merge pull request #2487 from fluidity-money/develop-final-prime-for-…
af-afk Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cmd/connector-common-lootboxes-timescale/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ package main

import (
"github.com/fluidity-money/fluidity-app/lib/databases/timescale/lootboxes"
"github.com/fluidity-money/fluidity-app/lib/databases/timescale/user-actions"
queue "github.com/fluidity-money/fluidity-app/lib/queues/lootboxes"
)

func main() {
queue.LootboxesAll(lootboxes.InsertLootbox)
queue.LootboxesAll(func(lootbox lootboxes.Lootbox) {
user_actions.UpdateAggregatedUserTransactionByHashWithLootbottles(
lootbox.LootboxCount,
lootbox.RewardTier,
lootbox.TransactionHash,
)

lootboxes.InsertLootbox(lootbox)
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ func main() {
RewardTier: rewardTier,
LootboxCount: lootboxCountFloat,
Application: application,
Epoch: currentEpoch,
}

queue.SendMessage(lootboxes_queue.TopicLootboxes, lootbox)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
-- migrate:up

DROP FUNCTION aggregated_user_transactions_lootbottles;

DROP TABLE aggregated_user_transactions_lootbottles_return;

ALTER TABLE aggregated_user_transactions
ADD COLUMN lootbox_count DECIMAL,
ADD COLUMN reward_tier INTEGER;

-- migrate:down

ALTER TABLE aggregated_user_transactions
DROP COLUMN lootbox_count,
DROP COLUMN reward_tier;

CREATE TABLE aggregated_user_transactions_lootbottles_return (
token_short_name VARCHAR NOT NULL,
network network_blockchain NOT NULL,
time TIMESTAMP WITHOUT TIME ZONE NOT NULL,
transaction_hash VARCHAR NOT NULL,
sender_address VARCHAR NOT NULL,
recipient_address VARCHAR NOT NULL,
amount DOUBLE PRECISION NOT NULL,
application VARCHAR NOT NULL,
winning_amount DOUBLE PRECISION NOT NULL,
winning_address VARCHAR NOT NULL,
reward_hash VARCHAR NOT NULL,
type user_action NOT NULL,
swap_in BOOLEAN NOT NULL,
utility_amount DOUBLE PRECISION NOT NULL,
utility_name VARCHAR NOT NULL,

lootbox_count DECIMAL,
reward_tier INTEGER
);

CREATE FUNCTION aggregated_user_transactions_lootbottles()
RETURNS SETOF aggregated_user_transactions_lootbottles_return
LANGUAGE SQL
STABLE
AS
$$
SELECT
token_short_name,
network,
time,
transaction_hash,
sender_address,
recipient_address,
amount,
application,
winning_amount,
winning_address,
reward_hash,
type user_action,
swap_in,
utility_amount,
utility_name,
lootbox_count,
reward_tier
FROM
aggregated_user_transactions
LEFT JOIN (
SELECT reward_tier, lootbox_count FROM lootbox
) AS lootbox_user_actions ON transaction_hash = aggregated_user_transactions.transaction_hash
$$;
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

-- migrate:up

INSERT INTO lootbox (
address,
source,
awarded_time,
volume,
reward_tier,
lootbox_count,
application,
epoch
)

VALUES
('0x75964ac8cc1676eb51451f25faaaefd40ccde602', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0x75964ac8cc1676eb51451f25faaaefd40ccde602', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0x75964ac8cc1676eb51451f25faaaefd40ccde602', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0x75964ac8cc1676eb51451f25faaaefd40ccde602', 'airdrop', timezone('utc', now()), 0, 4, 1, 'none', 'epoch_2'),
('0xd1d13003128cb454ff562850f86413498c1ebedf', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0xd1d13003128cb454ff562850f86413498c1ebedf', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0xd1d13003128cb454ff562850f86413498c1ebedf', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0x8cb42fe548bb51ca4125eac3c14cf177b2b183d8', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0x8cb42fe548bb51ca4125eac3c14cf177b2b183d8', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0x8cb42fe548bb51ca4125eac3c14cf177b2b183d8', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0xb363335ff6e0a91f870c200bf6fcb38d1fd0f346', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0xb363335ff6e0a91f870c200bf6fcb38d1fd0f346', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0xb363335ff6e0a91f870c200bf6fcb38d1fd0f346', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0x2d0eb64ffc36339a15c531b64fd55404ca7f8f62', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0x2d0eb64ffc36339a15c531b64fd55404ca7f8f62', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0x2d0eb64ffc36339a15c531b64fd55404ca7f8f62', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0x32f5de0d8f24094c660979ae34772985a1a8c831', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0x32f5de0d8f24094c660979ae34772985a1a8c831', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0x32f5de0d8f24094c660979ae34772985a1a8c831', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0x2da7958dc2a33e7720935102107f0886e8ab6574', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0x2da7958dc2a33e7720935102107f0886e8ab6574', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0x2da7958dc2a33e7720935102107f0886e8ab6574', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0xf6352e3a8e502b93af36821cc6f45d6f37ac4aed', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0xf6352e3a8e502b93af36821cc6f45d6f37ac4aed', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0xf6352e3a8e502b93af36821cc6f45d6f37ac4aed', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0xef05ee60799ea122db2ace21425f6d4991dd3805', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0xef05ee60799ea122db2ace21425f6d4991dd3805', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0xef05ee60799ea122db2ace21425f6d4991dd3805', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0x0b0154cbfaba8a18caf5fcba2b83ce383c1a0095', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0x0b0154cbfaba8a18caf5fcba2b83ce383c1a0095', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0x0b0154cbfaba8a18caf5fcba2b83ce383c1a0095', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2'),
('0x225e02bd307a5af7608ceff02a4e48ba06be4ddd', 'airdrop', timezone('utc', now()), 0, 1, 100, 'none', 'epoch_2'),
('0x225e02bd307a5af7608ceff02a4e48ba06be4ddd', 'airdrop', timezone('utc', now()), 0, 2, 50, 'none', 'epoch_2'),
('0x225e02bd307a5af7608ceff02a4e48ba06be4ddd', 'airdrop', timezone('utc', now()), 0, 3, 10, 'none', 'epoch_2');

INSERT INTO lootbox_config (
is_current_program,
program_begin,
program_end,
epoch_identifier,
ethereum_application
)

VALUES (
FALSE,
CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP + INTERVAL '30 days',
'epoch_2',
'none'
);

-- migrate:down

DELETE FROM lootbox
WHERE
(address = '0x75964ac8cc1676eb51451f25faaaefd40ccde602' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0x75964ac8cc1676eb51451f25faaaefd40ccde602' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0x75964ac8cc1676eb51451f25faaaefd40ccde602' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2') OR (address = '0x75964ac8cc1676eb51451f25faaaefd40ccde602' AND source = 'airdrop' AND reward_tier = 4 AND lootbox_count = 1 AND epoch = 'epoch_2')
OR (address = '0xd1d13003128cb454ff562850f86413498c1ebedf' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0xd1d13003128cb454ff562850f86413498c1ebedf' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0xd1d13003128cb454ff562850f86413498c1ebedf' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')
OR (address = '0x8cb42fe548bb51ca4125eac3c14cf177b2b183d8' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0x8cb42fe548bb51ca4125eac3c14cf177b2b183d8' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0x8cb42fe548bb51ca4125eac3c14cf177b2b183d8' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')
OR (address = '0xb363335ff6e0a91f870c200bf6fcb38d1fd0f346' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0xb363335ff6e0a91f870c200bf6fcb38d1fd0f346' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0xb363335ff6e0a91f870c200bf6fcb38d1fd0f346' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')
OR (address = '0x2d0eb64ffc36339a15c531b64fd55404ca7f8f62' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0x2d0eb64ffc36339a15c531b64fd55404ca7f8f62' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0x2d0eb64ffc36339a15c531b64fd55404ca7f8f62' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')
OR (address = '0x32f5de0d8f24094c660979ae34772985a1a8c831' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0x32f5de0d8f24094c660979ae34772985a1a8c831' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0x32f5de0d8f24094c660979ae34772985a1a8c831' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')
OR (address = '0x2da7958dc2a33e7720935102107f0886e8ab6574' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0x2da7958dc2a33e7720935102107f0886e8ab6574' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0x2da7958dc2a33e7720935102107f0886e8ab6574' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')
OR (address = '0xf6352e3a8e502b93af36821cc6f45d6f37ac4aed' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0xf6352e3a8e502b93af36821cc6f45d6f37ac4aed' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0xf6352e3a8e502b93af36821cc6f45d6f37ac4aed' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')
OR (address = '0xef05ee60799ea122db2ace21425f6d4991dd3805' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0xef05ee60799ea122db2ace21425f6d4991dd3805' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0xef05ee60799ea122db2ace21425f6d4991dd3805' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')
OR (address = '0x0b0154cbfaba8a18caf5fcba2b83ce383c1a0095' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0x0b0154cbfaba8a18caf5fcba2b83ce383c1a0095' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0x0b0154cbfaba8a18caf5fcba2b83ce383c1a0095' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')
OR (address = '0x225e02bd307a5af7608ceff02a4e48ba06be4ddd' AND source = 'airdrop' AND reward_tier = 1 AND lootbox_count = 100 AND epoch = 'epoch_2') OR (address = '0x225e02bd307a5af7608ceff02a4e48ba06be4ddd' AND source = 'airdrop' AND reward_tier = 2 AND lootbox_count = 50 AND epoch = 'epoch_2') OR (address = '0x225e02bd307a5af7608ceff02a4e48ba06be4ddd' AND source = 'airdrop' AND reward_tier = 3 AND lootbox_count = 10 AND epoch = 'epoch_2')

DELETE FROM lootbox_config WHERE epoch_identifier = 'epoch_2';
2 changes: 1 addition & 1 deletion lib/databases/timescale/lootboxes/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func GetLootboxConfig() (programFound bool, hasBegun bool, curEpoch string, curA
program_begin < (select timestamp from t) AND
program_end > (select timestamp from t),
epoch_identifier,
current_application
ethereum_application
FROM %s
WHERE is_current_program;`,

Expand Down
8 changes: 4 additions & 4 deletions lib/databases/timescale/lootboxes/rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ func UpdateOrInsertAmountsRewarded(network_ network.BlockchainNetwork, lootboxCu
$4,
$5,
$6,
$7
CURRENT_TIMESTAMP
)
ON CONFLICT (id)
ON CONFLICT (network, epoch, token_short_name, winner, application)
DO UPDATE SET
amount_earned = amount_earned + $4,
amount_earned = lootbox_amounts_rewarded.amount_earned + $4,
last_updated = CURRENT_TIMESTAMP`,

TableLootboxAmountsRewarded,
Expand All @@ -317,8 +317,8 @@ func UpdateOrInsertAmountsRewarded(network_ network.BlockchainNetwork, lootboxCu
lootboxCurrentEpoch,
tokenShortName,
amountNormalLossy,
application,
winnerAddress,
application,
)

if err != nil {
Expand Down
47 changes: 44 additions & 3 deletions lib/databases/timescale/user-actions/user-actions-aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import (
user_actions "github.com/fluidity-money/fluidity-app/lib/types/user-actions"
)

const (
TableAggregatedUserTransactions = `aggregated_user_transactions`
)
const TableAggregatedUserTransactions = `aggregated_user_transactions`

func InsertAggregatedUserTransaction(userTransaction user_actions.AggregatedUserTransaction) {
timescaleClient := timescale.Client()
Expand Down Expand Up @@ -218,3 +216,46 @@ func UpdateAggregatedUserTransactionByHash(userTransaction user_actions.Aggregat
})
}
}

// UpdateAggregatedUserTransactionByHashWithLootbottles after finding it first
func UpdateAggregatedUserTransactionByHashWithLootbottles(lootbottlesCount float64, rewardTier int, transactionHash string) {
timescaleClient := timescale.Client()

statementText := fmt.Sprintf(
`UPDATE %s
SET lootbox_count = $1, reward_tier = $2
WHERE transaction_hash = $3`,

TableAggregatedUserTransactions,
)

r, err := timescaleClient.Exec(
statementText,
lootbottlesCount,
rewardTier,
transactionHash,
)

if err != nil {
log.Fatal(func(k *log.Log) {
k.Context = Context
k.Message = "Failed to update an aggregated user transaction with a lootbottle"
k.Payload = err
})
}

rows, _ := r.RowsAffected()

if rows != 1 {
log.Fatal(func(k *log.Log) {
k.Context = Context

k.Format(
"%d rows affected by an aggregate user transaction with lootbottle update, expected 1!",
rows,
)

k.Payload = err
})
}
}
4 changes: 2 additions & 2 deletions lib/types/user-actions/user-actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ type (

// AggregatedTransactionFromUserAction to create a partially aggregated transaction from a user action
func AggregatedTransactionFromUserAction(userAction UserAction) AggregatedUserTransaction {
var (
var (
senderAddress string
recipientAddress string
)
Expand Down Expand Up @@ -180,7 +180,7 @@ func AggregatedTransactionFromPendingWinner(pendingWinner winners.PendingWinner)
SenderAddress: senderAddress,
// the sender is the winner of a pending win
WinningAddress: senderAddress,
Type: "send",
Type: "send",
}

if pendingWinner.Utility == "FLUID" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ export const JoeFarmlandsOrCamelotKingdomLinks = () => [
const JoeFarmlandsOrCamelotKingdom = () => {
return (
<div className="joe_farmlands_or_camelot_div">
<a href="#">
<a
href="https://traderjoexyz.com/arbitrum/pool/v21/0x4cfa50b7ce747e2d61724fcac57f24b748ff2b2a/0x912ce59144191c1204e64559fe8253a0e49e6548/25"
target="_blank"
rel="noreferrer"
>
<img
className="joe_farmlands_or_camelot_img_joe"
src="/images/joe-farmlands.png"
/>
</a>
<a href="#">
<a
href="https://app.camelot.exchange/pools/0xAc07ed4CbdDA2cB17F9AEca2919c825dCb2882B9"
target="_blank"
rel="noreferrer"
>
<img
className="joe_farmlands_or_camelot_img_camelot"
src="/images/kingdom-of-camelot.png"
Expand Down
1 change: 1 addition & 0 deletions web/app.fluidity.money/app/queries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export * from "./addReferral";
export * from "./useReferralCode";
export * from "./addReferralCode";
export * from "./useLootboxConfig";
export * from "./useLootBottles";
6 changes: 5 additions & 1 deletion web/app.fluidity.money/app/queries/useAirdropLeaderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { jsonPost, gql, fetchInternalEndpoint } from "~/util";

const queryByUserAllTime = gql`
query AirdropLeaderboard($epoch: lootbox_epoch!, $address: String!) {
airdrop_leaderboard(where: { address: { _eq: $address } }, limit: 1) {
airdrop_leaderboard(
args: { epoch_: $epoch }
where: { address: { _eq: $address } }
limit: 1
) {
user: address
rank
referralCount: referral_count
Expand Down
2 changes: 1 addition & 1 deletion web/app.fluidity.money/app/queries/useLootBottles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const QUERY_BY_TX_HASH = gql`
export type Lootbox = {
txHash?: string;
lootboxCount: number;
rewardTier: number;
rewardTier: Rarity;
};

type LootboxesByTxHashBody = {
Expand Down
2 changes: 1 addition & 1 deletion web/app.fluidity.money/app/queries/useLootBottlesCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BottleTiers } from "~/routes/$network/query/dashboard/airdrop";
import { jsonPost, gql, fetchInternalEndpoint } from "~/util";

const QUERY_REFERRALS_BY_ADDRESS = gql`
query getReferralLootboxCountByAddress($epoch: String!, $address: String!) {
query getReferralLootboxCountByAddress($epoch: lootbox_epoch!, $address: String!) {
referralLootboxCounts: lootbox_referral_lootbottle_counts(
args: { epoch_: $epoch }
where: { address: { _eq: $address } }
Expand Down
Loading