diff --git a/apps/nextjs/src/app/(app)/page.tsx b/apps/nextjs/src/app/(app)/page.tsx index 9453cb93..f4ed62da 100644 --- a/apps/nextjs/src/app/(app)/page.tsx +++ b/apps/nextjs/src/app/(app)/page.tsx @@ -1,8 +1,16 @@ import Image from "next/image"; import Link from "next/link"; import { GameCard } from "@/app/(app)/games/GameCard"; +import LordsIcon from "@/icons/lords.svg"; +import { api } from "@/trpc/server"; import { reader } from "@/utils/keystatic"; import { Button } from "@realms-world/ui/components/ui/button"; +import { + Card, + CardContent, + CardHeader, + CardTitle, +} from "@realms-world/ui/components/ui/card"; import { Carousel, CarouselContent, @@ -10,9 +18,11 @@ import { CarouselNext, CarouselPrevious, } from "@realms-world/ui/components/ui/carousel"; +import { formatNumber } from "@realms-world/utils"; import { PageLayout } from "../_components/PageLayout"; import { Partners } from "../_components/Partners"; +import { VeLordsRewardsChart } from "./account/lords/velords/VeLordsRewardsChart"; import { BlogGrid } from "./blogs/BlogGrid"; import CollectionsList from "./collection/CollectionsList"; @@ -37,6 +47,8 @@ export default async function Home() { title: game.entry.title, })); + const veLordsBurns = await api.veLordsBurns.sumByWeek(); + return ( @@ -71,6 +83,7 @@ export default async function Home() { +
@@ -90,10 +103,60 @@ export default async function Home() {
- {/*
-

Events

- -
*/} +
+
+ veLords background +
+
+

+ veLords - Lords Staking +

+ +
+ + + APY + + +

{formatNumber(12.34)}%

+
+
+ + + + + Lords Locked + + + +

+ + {formatNumber(1234567)} +

+
+
+ + + + + 90d Lords Rewards + + + +

+ + {formatNumber(98765)} +

+
+
+
+
+

diff --git a/apps/nextjs/src/app/api/dune/route.ts b/apps/nextjs/src/app/api/dune/route.ts index e3d2fe8c..749d5026 100644 --- a/apps/nextjs/src/app/api/dune/route.ts +++ b/apps/nextjs/src/app/api/dune/route.ts @@ -1,5 +1,4 @@ -import { api } from "@/trpc/react"; -import { DuneClient, QueryParameter } from "@duneanalytics/client-sdk"; +import { DuneClient } from "@duneanalytics/client-sdk"; import { db } from "@realms-world/db/client"; import { schema } from "@realms-world/db/schema"; import { env } from "env"; @@ -22,8 +21,9 @@ export async function GET(request: Request) { (row: Record) => ({ source: row.Name as string, amount: row.amount as string, + transaction_hash: row.transaction_hash as string, //block_time: new Date(row.block_time), - //epoch: row.epoch ? new Date(row.epoch) : null, + epoch: row.epoch ? new Date(row.epoch) : null, epoch_total_amount: row.epoch_total_amount as string, sender_epoch_total_amount: row.sender_epoch_total_amount as string, }), diff --git a/packages/db/src/schema/dune_velords.ts b/packages/db/src/schema/dune_velords.ts index c2bf580e..9e6fc604 100644 --- a/packages/db/src/schema/dune_velords.ts +++ b/packages/db/src/schema/dune_velords.ts @@ -1,11 +1,21 @@ -import { numeric, pgTable, text, timestamp } from "drizzle-orm/pg-core"; -import { createInsertSchema } from "drizzle-zod"; +import { + numeric, + pgTable, + primaryKey, + text, + timestamp, +} from "drizzle-orm/pg-core"; -export const velords_burns = pgTable("dune_velords_burns", { - source: text("source").notNull(), - amount: numeric("amount").notNull(), - //block_time: timestamp("block_time").notNull(), - //epoch: timestamp("epoch"), - epoch_total_amount: numeric("epoch_total_amount").notNull(), - sender_epoch_total_amount: numeric("sender_epoch_total_amount").notNull(), -}); +export const velords_burns = pgTable( + "dune_velords_burns", + { + source: text("source").notNull(), + amount: numeric("amount").notNull(), + transaction_hash: text("transaction_hash").notNull(), + //block_time: timestamp("block_time").notNull(), + //epoch: timestamp("epoch"), + epoch_total_amount: numeric("epoch_total_amount").notNull(), + sender_epoch_total_amount: numeric("sender_epoch_total_amount").notNull(), + }, + (t) => [primaryKey({ columns: [t.amount, t.transaction_hash] })], +);