Skip to content

Commit

Permalink
Chore: add superfest (#5879)
Browse files Browse the repository at this point in the history
* chore: Init

* chore: Add pools
  • Loading branch information
garethfuller authored Jul 9, 2024
1 parent 0ce6e3b commit 69ac1e6
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 13 deletions.
5 changes: 5 additions & 0 deletions src/assets/images/icons/protocols/superfest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 21 additions & 11 deletions src/components/banners/PointsBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,52 @@ const { hasPoints, poolPoints } = usePoints(props.pool);
function getIconSrc(protocol: Protocol) {
return protocolIconPaths[protocol];
}
const isPointsPool = computed(
() => hasPoints && poolPoints.value.some(p => p.multiple)
);
</script>

<template>
<div v-if="hasPoints" class="points-banner">
<span class="pb-3 sm:pb-0 leading-5"
>Liquidity providers in this pool also earn partner points</span
>
<span class="pb-3 sm:pb-0 leading-5">{{
isPointsPool
? 'Liquidity providers in this pool also earn partner points'
: 'Liquidity providers in this pool earn partner rewards'
}}</span>
<div class="flex">
<div
v-for="{ protocol, multiple, description } in poolPoints"
v-for="{ protocol, multiple, description, url } in poolPoints"
:key="protocol"
>
<BalTooltip placement="bottom" width="64">
<BalTooltip placement="bottom" width="64" :disabled="!description">
<template #activator>
<div
<component
:is="url ? 'a' : 'div'"
class="flex justify-center items-center py-2 px-3 ml-2 text-white rounded-full border border-gray-700 backdrop-blur-sm bg-black/20"
:href="url"
target="_blank"
rel="noopener noreferrer"
>
<BalAsset
:iconURI="getIconSrc(protocol)"
:alt="protocol"
class="mr-2"
:class="{ 'mr-2': multiple }"
/>
{{ multiple }}x
</div>
{{ multiple && `${multiple}x` }}
</component>
</template>
<div>
<div class="mb-2 font-bold">
<span class="capitalize">{{ protocol }}</span
>: {{ multiple }}x points multiplier
>{{ multiple && `: ${multiple}x points multiplier` }}
</div>
<div
v-if="description"
class="mb-2 list-disc"
v-html="description"
/>
<span>
<span v-if="multiple">
This UI does not provide real-time updates on partner point
multipliers. These points may change or expire and might not
reflect the most current info, please refer to the partner
Expand Down
5 changes: 5 additions & 0 deletions src/composables/useProtocols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum Protocol {
Kelp = 'kelp',
Mellow = 'mellow',
Symbiotic = 'symbiotic',
Superfest = 'superfest',
}

export const protocolIconPaths: Record<Protocol, string> = {
Expand Down Expand Up @@ -112,4 +113,8 @@ export const protocolIconPaths: Record<Protocol, string> = {
'@/assets/images/icons/protocols/symbiotic.svg',
import.meta.url
).href,
[Protocol.Superfest]: new URL(
'@/assets/images/icons/protocols/superfest.svg',
import.meta.url
).href,
};
26 changes: 25 additions & 1 deletion src/lib/config/fraxtal/pools.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CSP_ISSUE_POOL_IDS } from '@/constants/pool-lists/csp-issue';
import { PoolWarning, Pools } from '@/types/pools';
import { Network } from '../types';
import { Protocol } from '@/composables/useProtocols';

const pools: Pools = {
IdsMap: {},
Expand Down Expand Up @@ -48,7 +49,30 @@ const pools: Pools = {
},
Deep: [],
BoostedApr: [],
Metadata: {},
Metadata: {
'0x33251abecb0364df98a27a8d5d7b5ccddc774c42000000000000000000000008': {
points: [
{
protocol: Protocol.Superfest,
multiple: '',
url: 'https://jumper.exchange/superfest',
description:
'To find out more about Superfest, visit <a href="https://jumper.exchange/superfest" target="_blank" rel="noopener noreferrer">jumper.exchange/superfest</a>',
},
],
},
'0x1570315476480fa80cec1fff07a20c1df1adfd53000200000000000000000009': {
points: [
{
protocol: Protocol.Superfest,
multiple: '',
url: 'https://jumper.exchange/superfest',
description:
'To find out more about Superfest, visit <a href="https://jumper.exchange/superfest" target="_blank" rel="noopener noreferrer">jumper.exchange/superfest</a>',
},
],
},
},
DisabledJoins: [],
BrandedRedirect: {
Gyro2: 'gyro',
Expand Down
15 changes: 14 additions & 1 deletion src/lib/config/mode/pools.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CSP_ISSUE_POOL_IDS } from '@/constants/pool-lists/csp-issue';
import { PoolWarning, Pools } from '@/types/pools';
import { Network } from '../types';
import { Protocol } from '@/composables/useProtocols';

const pools: Pools = {
IdsMap: {},
Expand Down Expand Up @@ -42,7 +43,19 @@ const pools: Pools = {
},
Deep: [],
BoostedApr: [],
Metadata: {},
Metadata: {
'0xcf376bc82686be7f88fa8936c18c62a2f11c4003000200000000000000000009': {
points: [
{
protocol: Protocol.Superfest,
multiple: '',
url: 'https://jumper.exchange/superfest',
description:
'To find out more about Superfest, visit <a href="https://jumper.exchange/superfest" target="_blank" rel="noopener noreferrer">jumper.exchange/superfest</a>',
},
],
},
},
DisabledJoins: [],
BrandedRedirect: {
Gyro2: 'gyro',
Expand Down
1 change: 1 addition & 0 deletions src/types/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export type PoolMetadata = {
protocol: Protocol;
multiple: string;
description?: string;
url?: string;
expiryTimestamp?: number; // in secs - https://timestamp.online/
}[];
};
Expand Down

0 comments on commit 69ac1e6

Please sign in to comment.