Skip to content

Commit

Permalink
fix cache time
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Apr 15, 2024
1 parent 4954674 commit 2e1e8e5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dexs/rabbitx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getTimestampAtStartOfDay, getTimestampAtStartOfDayUTC, getTimestampAtSt

const historicalVolumeEndpoint = "https://api.prod.rabbitx.io/markets"
const candles = (market: string, timestampFrom: number, timestampTo: number) => {
const url = `https://api.prod.rabbitx.io/candles?market_id=${market}&timestamp_from=${timestampFrom}&timestamp_to=${timestampTo}&period=1440`;
const url = `https://api.prod.rabbitx.io/candles?market_id=${market}&timestamp_from=${timestampFrom}&timestamp_to=${timestampTo}&period=1440`;
return url;

}
Expand Down
2 changes: 1 addition & 1 deletion fees/arbitrum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const adapter: Adapter = {
`
// const seqGas: number = sequencerGas[0].sum
const seqGas: any = await queryIndexer(sequencerGas, options)
const feeQuery = await queryFlipside(`SELECT SUM(TX_FEE) from arbitrum.core.fact_transactions where BLOCK_NUMBER > ${startblock} AND BLOCK_NUMBER < ${endblock}`)
const feeQuery = await queryFlipside(`SELECT SUM(TX_FEE) from arbitrum.core.fact_transactions where BLOCK_NUMBER > ${startblock} AND BLOCK_NUMBER < ${endblock}`, 560)
const fees = Number(feeQuery[0][0])

dailyFees.addGasToken(fees * 1e18)
Expand Down
4 changes: 2 additions & 2 deletions fees/chainlink-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const fetchRequests = (chain: Chain) => {
const query_paid = build_link_query(timestamp)
const gas_query = build_gas_query(timestamp)

const linkPaid_logs: ILog[] = (await queryFlipside(query_paid, 360))
const linkPaid_logs: ILog[] = (await queryFlipside(query_paid, 560))
.map(([data, topics, transactionHash, chain]: [string, string[], string, string]) => {
return {
data,
Expand All @@ -80,7 +80,7 @@ const fetchRequests = (chain: Chain) => {
const payments = Number('0x'+data.slice(128, 192)) / 10 ** 18;
return payments;
}).reduce((a: number, b: number) => a + b, 0);
const ethGas = await queryFlipside(gas_query, 360)
const ethGas = await queryFlipside(gas_query, 560)

const gas_fees = ethGas.map(([fee, chain]: [string, string]) => {
return {
Expand Down
2 changes: 1 addition & 1 deletion fees/op-bnb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const fetch = async (timestamp: number, _chainBlocks: ChainBlocks, options: Fetc
and BLOCK_NUMBER > ${await getFromBlock()} AND BLOCK_NUMBER < ${await getToBlock()}
`

const cost_to_l1: number[] = (await queryFlipside(query, 260)).flat();
const cost_to_l1: number[] = (await queryFlipside(query, 560)).flat();
const dailyFees = await getFees(options)
const dailyRevenue = dailyFees.clone();
dailyRevenue.addGasToken((cost_to_l1[0] ?? 0) * 1e18 * -1)
Expand Down
2 changes: 1 addition & 1 deletion fees/polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const adapter: Adapter = {
LEFT JOIN
BlockTotals bt ON tt.BLOCK_NUMBER = bt.BLOCK_NUMBER;`

const [tx_fee, burn_fee]: number[] = (await queryFlipside(query_tx_fee, 260)).flat();
const [tx_fee, burn_fee]: number[] = (await queryFlipside(query_tx_fee, 560)).flat();
const maticAddress = "ethereum:" + ADDRESSES.ethereum.MATIC;

dailyFees.addTokenVannila(maticAddress, tx_fee * 1e18);
Expand Down

0 comments on commit 2e1e8e5

Please sign in to comment.