Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
32 changes: 32 additions & 0 deletions bridge-aggregators/cashmere/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import fetchURL from "../../utils/fetchURL";
import { FetchOptions, FetchResultVolume, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";

const CASHMERE_BRIDGE_API_URL = "https://kapi.cashmere.exchange/defillama/bridge/volumes";

const getUrl = (startTime: number, endTime: number): string => {
return `${CASHMERE_BRIDGE_API_URL}?from_timestamp=${startTime}&to_timestamp=${endTime}`;
};

const fetch = async (options: FetchOptions): Promise<FetchResultVolume> => {
const url = getUrl(options.startTimestamp, options.endTimestamp);
const response = await fetchURL(url);

return {
dailyBridgeVolume: response.volumeUsd || response.dailyBridgeVolume || 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, why response.volumeUsd || response.dailyBridgeVolume?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on second thought, excluding as we track bridge volume here: https://github.com/DefiLlama/bridges-server

};
};

const methodology = {
Volume: "Total volume of Cashmere cross-chain transfers.",
};

const adapter: SimpleAdapter = {
version: 2,
fetch,
chains: [CHAIN.ETHEREUM], // Aggregate data across all chains, represented under Ethereum
start: "2025-09-08",
methodology,
};

export default adapter;
44 changes: 44 additions & 0 deletions fees/cashmere/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import fetchURL from "../../utils/fetchURL";
import { FetchOptions, FetchResult, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";

const CASHMERE_API_URL = "https://kapi.cashmere.exchange/defillama/fees";

const getUrl = (startTime: number, endTime: number): string => {
return `${CASHMERE_API_URL}?from_timestamp=${startTime}&to_timestamp=${endTime}`;
};

const fetch = async (options: FetchOptions): Promise<FetchResult> => {
const url = getUrl(options.startTimestamp, options.endTimestamp);
const response = await fetchURL(url);

return {
dailyVolume: response.volumeUsd || 0,
dailyFees: response.feesUsd || 0,
dailyUserFees: response.feesUsd || 0,
dailyRevenue: response.revenuesUsd || 0,
dailyProtocolRevenue: response.protocolRevenueUsd || 0,
dailyHoldersRevenue: (response.revenuesUsd - response.protocolRevenueUsd) || 0,
dailySupplySideRevenue: (response.feesUsd - response.revenuesUsd) || 0,
};
};

const methodology = {
Volume: "Total cross-chain volume of the Cashmere",
Fees: "Total amount of fees paid by users for cross-chain Cashmere relayers",
UserFees: "Same as Fees - all fees are paid directly by end-users for Cashmere relayers",
Revenue: "All relayer fees are retained as protocol revenue",
ProtocolRevenue: "100% of fees go to protocol treasury",
HoldersRevenue: "No token holders revenue distribution - Cashmere operates as a service protocol without governance tokens",
SupplySideRevenue: "No liquidity providers - Cashmere operates bridge infrastructure, not AMM liquidity pools",
};

const adapter: SimpleAdapter = {
version: 2,
fetch,
chains: [CHAIN.ETHEREUM], // Aggregate data across all chains, represented under Ethereum
start: "2025-09-08",
methodology,
};

export default adapter;
Loading