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

add shadow-exchange #2273

Merged
merged 5 commits into from
Jan 2, 2025
Merged
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
62 changes: 62 additions & 0 deletions fees/shadow-exchange.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import * as sdk from "@defillama/sdk";
import { SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import {
DEFAULT_DAILY_VOLUME_FACTORY,
DEFAULT_TOTAL_VOLUME_FIELD,
getGraphDimensions2,
} from "../helpers/getUniSubgraph";

type TStartTime = {
[key: string]: number;
};
const startTimeV2: TStartTime = {
[CHAIN.SONIC]: 1735129946,
};

const v2Endpoints = {
[CHAIN.SONIC]:
sdk.graph.modifyEndpoint('QmQUpw87hb34A97MJZJcFNDfG9sP3ekSMojNKxVfPH8Ukw'),
};

const VOLUME_USD = "volumeUSD";

const v2Graphs = getGraphDimensions2({
graphUrls: v2Endpoints,
totalVolume: {
factory: "factories",
field: DEFAULT_TOTAL_VOLUME_FIELD,
},
feesPercent: {
type: "fees",
HoldersRevenue: 100,
UserFees: 100,
Revenue: 100,
SupplySideRevenue: 0,
ProtocolRevenue: 0,
},
});

const methodology = {
UserFees: "User pays 0.3% fees on each swap.",
ProtocolRevenue: "Revenue going to the protocol.",
HoldersRevenue: "User fees are distributed among holders.",
};

const adapter: SimpleAdapter = {
version: 2,
adapter: {
[CHAIN.SONIC]: {
fetch: v2Graphs(CHAIN.SONIC),
start: startTimeV2[CHAIN.SONIC],
meta: {
methodology: {
...methodology,
UserFees: "User pays 0.05%, 0.30%, or 1% on each swap.",
},
},
},
},
};

export default adapter;
Loading