Skip to content

fix: use calendar day for Rubic API queries - #9066

Draft
alpacai[bot] wants to merge 1 commit into
masterfrom
centaur/rubic-date-boundary-1788076249
Draft

fix: use calendar day for Rubic API queries#9066
alpacai[bot] wants to merge 1 commit into
masterfrom
centaur/rubic-date-boundary-1788076249

Conversation

@alpacai

@alpacai alpacai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Summary

Rubic's daily endpoint expects a UTC calendar-day timestamp, but the adapter passed startTimestamp, which the v1 runner sets one second before the day boundary. This could select the preceding day's API data and expose a large historical outlier under the wrong daily record; the adapter now passes startOfDay.

Changes

  • bridge-aggregators/rubic/index.ts: use the UTC calendar-day timestamp when querying Rubic's daily cross-chain volume endpoint.

Verification

  • DEBUG_BREAKDOWN_FEES=1 pnpm test bridge-aggregators rubic 2026-08-30 polygon -> exit 0; corrected Polygon volume 1.06 k (previously 58.50 M).
  • pnpm run ts-check -> exit 0.
  • pnpm run ts-check-cli -> exit 0.
  • git diff --check -> exit 0.
  • Not run: full all-chain CLI run; its generic runner probes unrelated chain RPCs that previously returned intermittent 408/500 errors.

@github-actions

Copy link
Copy Markdown

The rubic adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts bridge-aggregators rubic

🦙 Running RUBIC adapter 🦙
---------------------------------------------------
Start Date:	Sat, 29 Aug 2026 00:00:00 GMT
End Date:	Sun, 30 Aug 2026 00:00:00 GMT
---------------------------------------------------

error fetching block [Error: Llama RPC error! method: getBlock 
- host: https://lb.routeme.sh/rpc/evm/534352 error: Request failed with status code 429] {
  _underlyingError: '[object Object]',
  _isCustomError: true
}
error fetching block Error: No RPCs available for btr
    at LlamaProvider._performAction (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/.pnpm/@defillama+sdk@5.0.224_debug@4.4.3_supports-color@7.2.0__supports-color@7.2.0_typescript@5.9.3/node_modules/@defillama/sdk/build/util/LlamaProvider.js:104:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
error fetching block [Error: Llama RPC error! method: getBlock 
- host: https://evmexplorer.velas.com/rpc error: Cannot read properties of null (reading 'number')
- host: https://evmexplorer.velas.com/rpc error: Cannot read properties of null (reading 'number')
- host: https://explorer.velas.com/rpc error: Cannot read properties of null (reading 'number')] {
  _underlyingError: '[object Object]',
  _isCustomError: true
}
error fetching blockscroll Error getting block: scroll 1787961599 Request failed with status code 500
error fetching block [Error: Llama RPC error! method: getBlock 
- host: https://lb.routeme.sh/rpc/evm/534352 error: Request failed with status code 429] {
  _underlyingError: '[object Object]',
  _isCustomError: true
}
error fetching blockbtr Error getting block: btr 1787961599 Request failed with status code 500
error fetching block Error: No RPCs available for btr
    at LlamaProvider._performAction (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/.pnpm/@defillama+sdk@5.0.224_debug@4.4.3_supports-color@7.2.0__supports-color@7.2.0_typescript@5.9.3/node_modules/@defillama/sdk/build/util/LlamaProvider.js:104:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
error fetching blockvelas Error getting block: velas 1787961599 Request failed with status code 500
error fetching block [Error: Llama RPC error! method: getBlock 
- host: https://api.zilliqa.com error: Cannot read properties of null (reading 'number')
- host: https://lb.routeme.sh/rpc/evm/32769 error: Cannot read properties of null (reading 'number')] {
  _underlyingError: '[object Object]',
  _isCustomError: true
}
error fetching blockscroll Error getting block: scroll 1788047999 Request failed with status code 500
error fetching blockbtr Error getting block: btr 1788047999 Request failed with status code 500
error fetching block [Error: Llama RPC error! method: getBlock 
- host: https://filecoin.drpc.org error: requested block is outside available upstream range
- host: https://api.node.glif.io error: Request failed with status code 400
- host: https://api.chain.love/rpc/v1 error: Request failed with status code 400
- host: https://filfox.info/rpc/v1 error: failed to create Ethereum block from Filecoin tipset: failed to retrieve messages and receipts: error loading messages for tipset: [bafy2bzacealp5iighqjq2hpv7wcdeevibb6hrzmmkb6duztnw4jzcmaukr5ze bafy2bzaceaq7oactn7vwqscdeofj2i422ybyb4chvur24h6rj4izzxkmljj6u bafy2bzacedvk4a2vj47blf2624ifk5lkd5ho5jalukxlz5zv2mrfpbrt2i2ww]: failed to load state tree at tipset [bafy2bzacealp5iighqjq2hpv7wcdeevibb6hrzmmkb6duztnw4jzcmaukr5ze bafy2bzaceaq7oactn7vwqscdeofj2i422ybyb4chvur24h6rj4izzxkmljj6u bafy2bzacedvk4a2vj47blf2624ifk5lkd5ho5jalukxlz5zv2mrfpbrt2i2ww]: failed to load state tree bafy2bzacecic7wietqzmkz3uuk3tfhtoha6puew2ipgiscgzw33s5xr5voqka: failed to load hamt node: ipld: could not find bafy2bzacecic7wietqzmkz3uuk3tfhtoha6puew2ipgiscgzw33s5xr5voqka] {
  _underlyingError: '[object Object]',
  _isCustomError: true
}
error fetching block [Error: Llama RPC error! method: getBlock 
- host: https://evmexplorer.velas.com/rpc error: Cannot read properties of null (reading 'number')
- host: https://evmexplorer.velas.com/rpc error: Cannot read properties of null (reading 'number')
- host: https://explorer.velas.com/rpc error: Cannot read properties of null (reading 'number')] {
  _underlyingError: '[object Object]',
  _isCustomError: true
}
error fetching block [Error: Llama RPC error! method: getBlock 
- host: https://api.zilliqa.com error: Cannot read properties of null (reading 'number')
- host: https://lb.routeme.sh/rpc/evm/32769 error: Request failed with status code 429] {
  _underlyingError: '[object Object]',
  _isCustomError: true
}
error fetching block [Error: Llama RPC error! method: getBlock 
- host: https://filfox.info/rpc/v1 error: failed to create Ethereum block from Filecoin tipset: failed to retrieve messages and receipts: error loading messages for tipset: [bafy2bzacealp5iighqjq2hpv7wcdeevibb6hrzmmkb6duztnw4jzcmaukr5ze bafy2bzaceaq7oactn7vwqscdeofj2i422ybyb4chvur24h6rj4izzxkmljj6u bafy2bzacedvk4a2vj47blf2624ifk5lkd5ho5jalukxlz5zv2mrfpbrt2i2ww]: failed to load state tree at tipset [bafy2bzacealp5iighqjq2hpv7wcdeevibb6hrzmmkb6duztnw4jzcmaukr5ze bafy2bzaceaq7oactn7vwqscdeofj2i422ybyb4chvur24h6rj4izzxkmljj6u bafy2bzacedvk4a2vj47blf2624ifk5lkd5ho5jalukxlz5zv2mrfpbrt2i2ww]: failed to load state tree bafy2bzacecic7wietqzmkz3uuk3tfhtoha6puew2ipgiscgzw33s5xr5voqka: failed to load hamt node: ipld: could not find bafy2bzacecic7wietqzmkz3uuk3tfhtoha6puew2ipgiscgzw33s5xr5voqka
- host: https://api.node.glif.io error: Request failed with status code 400
- host: https://api.chain.love/rpc/v1 error: Request failed with status code 400
- host: https://filecoin.drpc.org error: requested block is outside available upstream range] {
  _underlyingError: '[object Object]',
  _isCustomError: true
}
error fetching block Error: No RPCs available for ftn
    at LlamaProvider._performAction (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/.pnpm/@defillama+sdk@5.0.224_debug@4.4.3_supports-color@7.2.0__supports-color@7.2.0_typescript@5.9.3/node_modules/@defillama/sdk/build/util/LlamaProvider.js:104:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
error fetching blockftn Error getting block: ftn 1787961599 Request failed with status code 500
error fetching block Error: No RPCs available for ftn
    at LlamaProvider._performAction (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/.pnpm/@defillama+sdk@5.0.224_debug@4.4.3_supports-color@7.2.0__supports-color@7.2.0_typescript@5.9.3/node_modules/@defillama/sdk/build/util/LlamaProvider.js:104:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
error fetching blockftn Error getting block: ftn 1788047999 Request failed with status code 500
chain       | Daily bridge volume | Start Time
---         | ---                 | ---       
solana      | 2.85 k              | 1/1/2023  
ethereum    | 49.36 k             | 1/1/2023  
bsc         | 294.11 k            | 1/1/2023  
avax        | 0.00                | 1/1/2023  
polygon     | 1.06 k              | 1/1/2023  
arbitrum    | 23.24 k             | 1/1/2023  
blast       | 0.00                | 1/1/2023  
linea       | 0.00                | 1/1/2023  
scroll      | 0.00                | 1/1/2023  
zeta        | 0.00                | 1/1/2023  
mantle      | 0.00                | 1/1/2023  
manta       | 0.00                | 1/1/2023  
pulse       | 0.00                | 1/1/2023  
base        | 5.19 k              | 1/1/2023  
fantom      | 0.00                | 1/1/2023  
boba        | 0.00                | 1/1/2023  
telos       | 0.00                | 1/1/2023  
kava        | 0.00                | 1/1/2023  
optimism    | 331.00              | 1/1/2023  
aurora      | 0.00                | 1/1/2023  
metis       | 0.00                | 1/1/2023  
tron        | 754.00              | 1/1/2023  
fuse        | 0.00                | 1/1/2023  
celo        | 0.00                | 1/1/2023  
cronos      | 0.00                | 1/1/2023  
mode        | 3.91                | 1/1/2023  
merlin      | 0.00                | 1/1/2023  
core        | 0.00                | 1/1/2023  
taiko       | 0.00                | 1/1/2023  
zklink      | 0.00                | 1/1/2023  
btr         | 0.00                | 1/1/2023  
bitcoin     | 782.00              | 1/1/2023  
berachain   | 1.75                | 1/1/2023  
aptos       | 0.00                | 1/1/2023  
algorand    | 0.00                | 1/1/2023  
astar       | 0.00                | 1/1/2023  
cardano     | 0.00                | 1/1/2023  
eos         | 0.00                | 1/1/2023  
dogechain   | 0.00                | 1/1/2023  
filecoin    | 0.00                | 1/1/2023  
flow        | 0.00                | 1/1/2023  
hedera      | 0.00                | 1/1/2023  
icp         | 0.00                | 1/1/2023  
sui         | 0.00                | 1/1/2023  
unichain    | 0.00                | 1/1/2023  
morph       | 0.00                | 1/1/2023  
fraxtal     | 0.00                | 1/1/2023  
sonic       | 0.00                | 1/1/2023  
soneium     | 0.00                | 1/1/2023  
gravity     | 0.00                | 1/1/2023  
rsk         | 0.00                | 1/1/2023  
xlayer      | 0.00                | 1/1/2023  
sei         | 0.00                | 1/1/2023  
ftn         | 0.00                | 1/1/2023  
klaytn      | 0.00                | 1/1/2023  
velas       | 0.00                | 1/1/2023  
syscoin     | 0.00                | 1/1/2023  
flare       | 18.00               | 1/1/2023  
ton         | 2.31 k              | 1/1/2023  
cosmos      | 0.00                | 1/1/2023  
litecoin    | 0.00                | 1/1/2023  
osmosis     | 0.00                | 1/1/2023  
ripple      | 5.72 k              | 1/1/2023  
polkadex    | 0.00                | 1/1/2023  
stellar     | 946.00              | 1/1/2023  
near        | 1.17                | 1/1/2023  
tezos       | 0.00                | 1/1/2023  
waves       | 0.00                | 1/1/2023  
wax         | 0.00                | 1/1/2023  
xdc         | 2.81 k              | 1/1/2023  
neo         | 0.00                | 1/1/2023  
hemi        | 0.00                | 1/1/2023  
zilliqa     | 0.00                | 1/1/2023  
monad       | 0.00                | 1/1/2023  
megaeth     | 0.00                | 1/1/2023  
plasma      | 0.00                | 1/1/2023  
hyperliquid | 0.00                | 1/1/2023  
Aggregate   | 389.49 k            |           

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants