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

Pulling refs/heads/staging into test-staging #2250

Merged
merged 3 commits into from
Feb 8, 2024
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
16 changes: 8 additions & 8 deletions lib/constants/foreign-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ const PROD_FOREIGN_ASSET_METADATA: ForeignAssetMetadata = {
tokenSymbol: "DOT",
subsquidId: "DOT",
},
// 1: {
// originChain: "Moonbeam",
// image: "/currencies/usdc.svg",
// withdrawSupported: false,
// coinGeckoId: "usd",
// tokenSymbol: "USDC",
// subsquidId: "USDC",
// },
1: {
originChain: "Moonbeam",
image: "/currencies/usdc.svg",
withdrawSupported: false,
coinGeckoId: "usd",
tokenSymbol: "USDC",
subsquidId: "USDC",
},
};

export const FOREIGN_ASSET_METADATA: ForeignAssetMetadata =
Expand Down
14 changes: 7 additions & 7 deletions lib/constants/supported-currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export const supportedCurrencies = [
twColor: "polkadot",
assetId: { ForeignAsset: 0 } as const,
} satisfies CurrencyMetadata,
// {
// name: "USDC" as const,
// description: "Create market with Moonbeam USDC.wh as the base asset.",
// image: "/currencies/usdc.svg",
// twColor: "usdc",
// assetId: { ForeignAsset: 1 } as const,
// } satisfies CurrencyMetadata,
{
name: "USDC" as const,
description: "Create market with Moonbeam USDC.wh as the base asset.",
image: "/currencies/usdc.svg",
twColor: "usdc",
assetId: { ForeignAsset: 1 } as const,
} satisfies CurrencyMetadata,
] as const;

export type SupportedCurrencyTag = Unpacked<
Expand Down
12 changes: 7 additions & 5 deletions lib/gql/historical-prices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ export const getBaseAssetHistoricalPrices = async (): Promise<BasePrices> => {
"zeitgeist",
];

const generateUrl = COIN_GECKO_API_KEY
? (id: string) =>
`https://pro-api.coingecko.com/api/v3/coins/${id}/market_chart?vs_currency=usd&days=10000&x_cg_pro_api_key=${COIN_GECKO_API_KEY}`
: (id: string) =>
`https://api.coingecko.com/api/v3/coins/${id}/market_chart?vs_currency=usd&days=10000`;

const pricesRes = await Promise.all(
coinGeckoIds.map((id) =>
fetch(
`https://api.coingecko.com/api/v3/coins/${id}/market_chart?vs_currency=usd&days=10000&${COIN_GECKO_API_KEY}`,
),
),
coinGeckoIds.map((id) => fetch(generateUrl(id))),
);

const prices = await Promise.all(pricesRes.map((res) => res.json()));
Expand Down
2 changes: 1 addition & 1 deletion lib/state/market-creation/constants/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import { SupportedCurrencyTag } from "lib/constants/supported-currencies";
export const minBaseLiquidity: Record<SupportedCurrencyTag, number> = {
ZTG: 200,
DOT: 10,
// USDC: 50,
USDC: 50,
};
7 changes: 3 additions & 4 deletions pages/leaderboard/[period].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ import { useMemo } from "react";
// "In events": swaps, buy full set
// "Out events": swaps, sell full set, redeem

// const TimePeriodItems = ["month", "year", "all"] as const;
const TimePeriodItems = ["year"] as const;
const TimePeriodItems = ["month", "year", "all"] as const;
type TimePeriod = (typeof TimePeriodItems)[number];

const durationLookup: { [key in TimePeriod]: number } = {
// week: DAY_SECONDS * 1000 * 7,
// month: DAY_SECONDS * 1000 * 30,
month: DAY_SECONDS * 1000 * 30,
year: DAY_SECONDS * 1000 * 365,
// all: DAY_SECONDS * 1000 * 365 * 100,
all: DAY_SECONDS * 1000 * 365 * 100,
};

type Trade = {
Expand Down
Loading