Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
NEXT_PUBLIC_PROJECT_ID=""
NEXT_PUBLIC_PROJECT_ID=""

# Subgraph deploy (optional; for subgraph/deploy-production-no-prompt.sh)
# Get deploy key from https://thegraph.com/studio/ → your subgraph → Deploy key
# GRAPH_DEPLOY_KEY=""
# GRAPH_VERSION_LABEL="v0.1.2-metals-oracle"
318 changes: 198 additions & 120 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"husky": "^9.1.7",
"lint-staged": "^15.4.3",
"postcss": "^8.4.35",
"sharp": "^0.34.5",
"tailwindcss": "^3.4.1",
"typescript": "^5.9.2"
},
Expand Down
Binary file modified public/icons/haGOLD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions scripts/make-png-transparent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env node
/**
* One-off script: make black background of haGOLD.png transparent.
* Usage: node scripts/make-png-transparent.js
*/
const fs = require("fs");
const path = require("path");
const sharp = require("sharp");

const inputPath = path.join(__dirname, "../public/icons/haGOLD.png");
const outputPath = inputPath;

async function main() {
const { data, info } = await sharp(inputPath)
.ensureAlpha()
.raw()
.toBuffer({ resolveWithObject: true });

const { width, height, channels } = info;
const BLACK_THRESHOLD = 40;

for (let i = 0; i < data.length; i += channels) {
const r = data[i];
const g = data[i + 1];
const b = data[i + 2];
if (r <= BLACK_THRESHOLD && g <= BLACK_THRESHOLD && b <= BLACK_THRESHOLD) {
data[i + 3] = 0; // set alpha to 0
}
}

await sharp(data, { raw: { width, height, channels } })
.png()
.toFile(outputPath);

console.log("Done: black background made transparent in", outputPath);
}

main().catch((err) => {
console.error(err);
process.exit(1);
});
36 changes: 36 additions & 0 deletions scripts/query-marks-debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Query the Harbor Marks subgraph for a wallet to debug "marks not accumulating".
# Usage:
# GRAPH_URL="https://api.studio.thegraph.com/query/1718836/harbor-marks/v0.1.1-metals-bonus" ./scripts/query-marks-debug.sh 0xAE7Dbb17bc40D53A6363409c6B1ED88d3cFdc31e
# Or use your staging subgraph URL (same as NEXT_PUBLIC_GRAPH_URL):
# GRAPH_URL="<your-staging-graph-url>" ./scripts/query-marks-debug.sh 0xAE7Dbb17bc40D53A6363409c6B1ED88d3cFdc31e

WALLET="${1:-0xAE7Dbb17bc40D53A6363409c6B1ED88d3cFdc31e}"
GRAPH_URL="${GRAPH_URL:-https://api.studio.thegraph.com/query/1718836/harbor-marks/v0.1.1-metals-bonus}"
USER_LOWER=$(echo "$WALLET" | tr '[:upper:]' '[:lower:]')

# Metals genesis addresses (lowercase)
FXUSD_GOLD="0x2cbf457112ef5a16cfca10fb173d56a5cc9daa66"
STETH_GOLD="0x8ad6b177137a6c33070c27d98355717849ce526c"
FXUSD_SILVER="0x66d18b9dd5d1cd51957dfea0e0373b54e06118c8"
STETH_SILVER="0x8f655ca32a1fa8032955989c19e91886f26439dc"

echo "Querying subgraph: $GRAPH_URL"
echo "Wallet: $WALLET"
echo ""

for GENESIS in "$FXUSD_GOLD" "$STETH_GOLD" "$FXUSD_SILVER" "$STETH_SILVER"; do
ID="${GENESIS}-${USER_LOWER}"
NAME="$GENESIS"
case "$GENESIS" in
$FXUSD_GOLD) NAME="fxUSD-GOLD" ;;
$STETH_GOLD) NAME="stETH-GOLD" ;;
$FXUSD_SILVER) NAME="fxUSD-SILVER" ;;
$STETH_SILVER) NAME="stETH-SILVER" ;;
esac
echo "--- $NAME (id: $ID) ---"
curl -s -X POST "$GRAPH_URL" \
-H "Content-Type: application/json" \
-d "{\"query\":\"query { userHarborMarks(id: \\\"$ID\\\") { currentMarks campaignId currentDepositUSD } }\"}" | jq .
echo ""
done
38 changes: 29 additions & 9 deletions src/app/api/landing/summary/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,21 +430,36 @@ export async function GET(request: Request) {
name: string;
symbol?: string;
collateralSymbol?: string;
peggedSymbol?: string;
leveragedSymbol?: string;
pegTarget?: string;
campaignId?: string;
projectedApr: number | null;
longSide: string;
shortSide: string;
phase: "live" | "coming-next" | "planned";
status?: string;
}>
>();

for (const [marketId, market] of maidenVoyageMarkets) {
const title =
const campaignLabel =
(market as any)?.marksCampaign?.label ||
"Maiden Voyage";
const collateralSymbol = market.collateral?.symbol?.toLowerCase();
const campaignId = (market as any)?.marksCampaign?.id;
const collateralSymbol = market.collateral?.symbol;
const peggedSymbol = market.peggedToken?.symbol;
const leveragedSymbol = market.leveragedToken?.symbol;
const pegTarget = (market as any)?.pegTarget;
const status = (market as any)?.status;
const collateralSymbolLower = collateralSymbol?.toLowerCase();
let projectedApr: number | null = null;
if (collateralSymbol === "fxsave") {
if (collateralSymbolLower === "fxsave") {
projectedApr = defillamaApys.fxsaveApyPercent;
} else if (collateralSymbol === "wsteth" || collateralSymbol === "steth") {
} else if (
collateralSymbolLower === "wsteth" ||
collateralSymbolLower === "steth"
) {
projectedApr = defillamaApys.wstethApyPercent;
}

Expand All @@ -456,7 +471,7 @@ export async function GET(request: Request) {
: null;
const now = Date.now();
let phase: "live" | "coming-next" | "planned" = "planned";
const isComingSoon = (market as any).status === "coming-soon";
const isComingSoon = status === "coming-soon";
const hasEnded = endDate !== null && now > endDate;
if (hasEnded && !isComingSoon) {
continue;
Expand All @@ -467,23 +482,28 @@ export async function GET(request: Request) {
phase = "coming-next";
} else if (endDate && now <= endDate) {
phase = "live";
} else if ((market as any).status === "genesis") {
} else if (status === "genesis") {
phase = "live";
}

const entry = {
marketId,
name: market.name,
symbol: market.peggedToken?.symbol,
collateralSymbol: market.collateral?.symbol,
collateralSymbol,
peggedSymbol,
leveragedSymbol,
pegTarget,
campaignId,
projectedApr,
longSide: parseLongSide(market),
shortSide: parseShortSide(market),
phase,
status,
};
const list = maidenVoyagesMap.get(title) || [];
const list = maidenVoyagesMap.get(campaignLabel) || [];
list.push(entry);
maidenVoyagesMap.set(title, list);
maidenVoyagesMap.set(campaignLabel, list);
}

const maidenVoyages = Array.from(maidenVoyagesMap.entries()).map(
Expand Down
Loading