Skip to content

Commit

Permalink
add isExpensiveAdapter field
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Feb 29, 2024
1 parent 46166fb commit 70aa2c8
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 11 deletions.
13 changes: 7 additions & 6 deletions adapters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,21 @@ export enum ProtocolType {
COLLECTION = 'collection',
}

export type SimpleAdapter = {
export type AdapterBase = {
timetravel?: boolean
adapter: BaseAdapter
isExpensiveAdapter?: boolean,
protocolType?: ProtocolType;
version?: number;
}

export type BreakdownAdapter = {
timetravel?: boolean
version?: number;
export type SimpleAdapter = AdapterBase & {
adapter: BaseAdapter
}

export type BreakdownAdapter = AdapterBase & {
breakdown: {
[version: string]: BaseAdapter
};
protocolType?: ProtocolType;
};

export type Adapter = SimpleAdapter | BreakdownAdapter;
Expand Down
3 changes: 2 additions & 1 deletion aggregators/1inch-agg/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FetchResult, SimpleAdapter } from "../../adapters/types";
import { FetchResult, } from "../../adapters/types";
import { getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume";
import { fetchURLWithRetry } from "../../helpers/duneRequest";

Expand Down Expand Up @@ -43,6 +43,7 @@ const adapter: any = {
};
}, {}),
},
isExpensiveAdapter: true,
};

export default adapter;
1 change: 1 addition & 0 deletions aggregators/conveyor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const adapter: any = {
};
}, {}),
},
isExpensiveAdapter: true,
};

export default adapter;
1 change: 1 addition & 0 deletions dexs/jupiter-perpetual/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const adapter = {
},
},
},
isExpensiveAdapter: true,
};

export default adapter;
1 change: 1 addition & 0 deletions dexs/sanctum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const adapter: SimpleAdapter = {
runAtCurrTime: true,
},
},
isExpensiveAdapter: true,
};

export default adapter;
1 change: 1 addition & 0 deletions fees/arbitrum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const adapter: Adapter = {
start: 1628553600
},
},
isExpensiveAdapter: true,
protocolType: ProtocolType.CHAIN
}

Expand Down
1 change: 1 addition & 0 deletions fees/banana-gun-trading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const adapter: SimpleAdapter = {
start: async () => 1685577600,
},
},
isExpensiveAdapter: true,
};

export default adapter;
4 changes: 2 additions & 2 deletions fees/chainlink-requests.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { SimpleAdapter, ChainBlocks, FetchResultFees } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import { getPrices } from "../utils/prices";
import { getBlock } from "../helpers/getBlock";
import { queryFlipside } from "../helpers/flipsidecrypto";
import { Chain } from "@defillama/sdk/build/general";

Expand Down Expand Up @@ -132,6 +131,7 @@ const adapter: SimpleAdapter = {
fetch: fetchRequests(CHAIN.AVAX),
start: 1675382400,
},
}
},
isExpensiveAdapter: true,
}
export default adapter;
1 change: 0 additions & 1 deletion fees/gamma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// import * as sdk from "@defillama/sdk";
// import { CHAIN } from "../helpers/chains";
// import { getPrices } from "../utils/prices";
// import { queryFlipside } from "../helpers/flipsidecrypto";

import { FetchResultFees, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
Expand Down
2 changes: 1 addition & 1 deletion fees/gmx-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Chain } from "@defillama/sdk/build/general";
import { Adapter, FetchResultFees } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import { queryDune } from "../../helpers/dune";
import { fetchURLWithRetry } from "../../helpers/duneRequest";
import { getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume";


Expand Down Expand Up @@ -47,5 +46,6 @@ const adapter: Adapter = {
runAtCurrTime: true,
},
},
isExpensiveAdapter: true,
};
export default adapter;
1 change: 1 addition & 0 deletions fees/op-bnb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const adapter: Adapter = {
start: 1691971200,
},
},
isExpensiveAdapter: true,
protocolType: ProtocolType.CHAIN
}

Expand Down
1 change: 1 addition & 0 deletions fees/polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const adapter: Adapter = {
start: 1672531200
},
},
isExpensiveAdapter: true,
protocolType: ProtocolType.CHAIN
}

Expand Down
1 change: 1 addition & 0 deletions fees/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const adapter: Adapter = {
runAtCurrTime: true,
},
},
isExpensiveAdapter: true,
protocolType: ProtocolType.CHAIN
}

Expand Down

0 comments on commit 70aa2c8

Please sign in to comment.