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

Update from upstream #2

Open
wants to merge 2,260 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2260 commits
Select commit Hold shift + click to select a range
dd203e7
fix fwx fee
Sep 11, 2024
34e8deb
timestamp update
buchaoqun Sep 11, 2024
5e35fa1
added wolfswap aggregator
axldefi Sep 11, 2024
5325bcf
Fix API endpoint
shuva10v Sep 11, 2024
0451acb
fix zeno
dtmkeng Sep 11, 2024
26c4a7a
Merge pull request #1890 from re-doubt/hotfix/haspump_endpoint
dtmkeng Sep 11, 2024
5a4889c
Merge pull request #1888 from idea2409/fwx
dtmkeng Sep 11, 2024
3a6305c
zyber
waynebruce0x Sep 11, 2024
eefff16
colony
waynebruce0x Sep 11, 2024
a73d87a
feat:add dailyFees/dailyRevenue for ref finance
xieqiancaosissi Sep 11, 2024
c6f30da
beamswap refactor
waynebruce0x Sep 11, 2024
d5bce1a
refactor fluid
dtmkeng Sep 11, 2024
b11b6ca
feat(Project): Add dHEDGE Fees
TomShear Sep 11, 2024
05cec74
Merge pull request #1892 from DefiLlama/balv2
waynebruce0x Sep 11, 2024
3a8138c
protocols
waynebruce0x Sep 11, 2024
622bf40
Merge branch 'DefiLlama:master' into master
buchaoqun Sep 12, 2024
70d835a
update trade volume api FWX
Sep 12, 2024
1f906ee
feat: update lista fees
Sep 12, 2024
74482fd
track pancake stableswap on ethereum
g1nt0ki Sep 12, 2024
5815a7e
removed depricated apis for logx and added new network apis
arpitsingh1409 Sep 12, 2024
79fe262
update logic
buchaoqun Sep 12, 2024
ebb9711
Add swap.coffee adapter
SHADOWDANCH Sep 3, 2024
5545166
Merge pull request #1896 from DefiLlama/balv2
waynebruce0x Sep 12, 2024
89c83cd
add core
buchaoqun Sep 12, 2024
abb00ec
Merge pull request #1889 from axldefi/master
dtmkeng Sep 12, 2024
127caaa
fix get event logs
dtmkeng Sep 12, 2024
e6e8feb
debug
waynebruce0x Sep 12, 2024
2135bcf
Merge pull request #1900 from DefiLlama/debug
waynebruce0x Sep 12, 2024
0f45f72
Merge pull request #1895 from dhedge/feat/fees-dhedge
dtmkeng Sep 12, 2024
e119cd2
quickswap
waynebruce0x Sep 12, 2024
f2fc8fc
Merge pull request #1901 from DefiLlama/debug
waynebruce0x Sep 12, 2024
99dc269
feat(Project): Add Toros Fees
TomShear Sep 12, 2024
18e31b8
traderjoe
waynebruce0x Sep 12, 2024
5b933b4
sushi
waynebruce0x Sep 12, 2024
e7c1601
Merge pull request #1887 from ArrowDFMs/arrow-markets
dtmkeng Sep 12, 2024
b2ee4c7
fix query
dtmkeng Sep 12, 2024
2b22584
Merge pull request #1898 from tyler-tsai/feat/update-lista-fees
dtmkeng Sep 12, 2024
2331eae
Merge pull request #1894 from xieqiancaosissi/master
dtmkeng Sep 12, 2024
37e207a
Merge pull request #1886 from LeifuChen/fix/update-kwenta-subgraph
dtmkeng Sep 12, 2024
073974c
chore: IntentX 0.8.3 subgraph migration
degencreator Sep 12, 2024
b935018
add new protocol adapter
realdealshaman Sep 12, 2024
25166ab
Merge branch 'DefiLlama:master' into master
buchaoqun Sep 13, 2024
7e31986
new stat fetch for bsc upgrade
algtm Sep 13, 2024
3157d4d
add dailyRevenue
buchaoqun Sep 13, 2024
b9a1920
fix primex
g1nt0ki Sep 13, 2024
cceca58
bmx
waynebruce0x Sep 13, 2024
712601d
Merge pull request #1904 from avatarwallet/master
dtmkeng Sep 13, 2024
bfd80dc
added all kiloex chains
Sep 13, 2024
5fc4c50
Merge pull request #1905 from vooi-app/master
dtmkeng Sep 13, 2024
e72a220
Merge pull request #1903 from Intent-X/master
dtmkeng Sep 13, 2024
375e2db
add fee & volume for pear
literallymarvellous Sep 13, 2024
4cc3679
add fee & volume for pear
literallymarvellous Sep 13, 2024
b94a645
Update subgraphs
daedboi Sep 13, 2024
56862f1
fix pool total decimals
buchaoqun Sep 14, 2024
71d0d73
Merge branch 'DefiLlama:master' into master
buchaoqun Sep 14, 2024
b923245
fix timestamp decimals
buchaoqun Sep 14, 2024
158b767
fix timesatmp edit
buchaoqun Sep 14, 2024
6e6e8fd
Merge branch 'DefiLlama:master' into master
arpitsingh1409 Sep 14, 2024
d5b128e
Merge pull request #1899 from SHADOWDANCH/swap-coffee
dtmkeng Sep 14, 2024
1ab09a0
fix error fluid
dtmkeng Sep 15, 2024
cd91e18
Merge pull request #1912 from DefiLlama/fix-error-fluid
dtmkeng Sep 15, 2024
f79ad73
Delete yarn.lock
dtmkeng Sep 15, 2024
f72b723
Merge pull request #1908 from morphex-labs/master
dtmkeng Sep 15, 2024
8cfba16
update api endpoint
literallymarvellous Sep 15, 2024
462ec5c
update dex endpoint
literallymarvellous Sep 15, 2024
2af3e1a
fix tests
literallymarvellous Sep 15, 2024
85e5c3e
Merge pull request #1906 from literallymarvellous/add-pear-volume
dtmkeng Sep 15, 2024
f4024e5
Merge pull request #1911 from arpitsingh1409/master
dtmkeng Sep 15, 2024
1db2f7e
fix logx
dtmkeng Sep 15, 2024
6c4e75d
Merge branch 'master' into debug
waynebruce0x Sep 15, 2024
53f4a2e
Merge pull request #1913 from DefiLlama/debug
waynebruce0x Sep 15, 2024
be0609a
Merge pull request #1897 from idea2409/fwx
dtmkeng Sep 16, 2024
e1a4fd6
pcs
waynebruce0x Sep 16, 2024
e1e6fcf
ramses
waynebruce0x Sep 16, 2024
a3937b7
joe
waynebruce0x Sep 16, 2024
dfa2ddf
sushi
waynebruce0x Sep 16, 2024
537991b
lynex
waynebruce0x Sep 16, 2024
2e540fc
solidly
waynebruce0x Sep 16, 2024
90926c9
pharaoh
waynebruce0x Sep 16, 2024
6ca399d
nile
waynebruce0x Sep 16, 2024
65e5592
swaap
waynebruce0x Sep 16, 2024
fc2903c
Merge pull request #1914 from DefiLlama/kibana-fixes
waynebruce0x Sep 16, 2024
afd0590
clipper
waynebruce0x Sep 16, 2024
432fed9
vvs
waynebruce0x Sep 16, 2024
1afd285
syncswap
waynebruce0x Sep 16, 2024
3e6db54
based
waynebruce0x Sep 16, 2024
f91a216
zebra
waynebruce0x Sep 16, 2024
bc8fe21
pulsex
waynebruce0x Sep 16, 2024
7b24b6f
Add SparkDEX V3 adapters on Flare
0xrmvdao Sep 16, 2024
3fc9c77
Merge branch 'DefiLlama:master' into master
0xrmvdao Sep 16, 2024
836b85c
dragon v2
waynebruce0x Sep 16, 2024
e6f5dd8
apeswap
waynebruce0x Sep 16, 2024
d42012c
pangolin
waynebruce0x Sep 16, 2024
c083776
Merge pull request #1915 from DefiLlama/kibana-fixes
waynebruce0x Sep 16, 2024
066dfea
fix dragonswap-sei
dtmkeng Sep 16, 2024
7cf8914
Merge pull request #1910 from solv-finance-dev/master
dtmkeng Sep 16, 2024
de2973e
not v2
0xngmi Sep 17, 2024
295b385
fix version of univ2DimensionAdapter
dtmkeng Sep 17, 2024
b0bba3d
Merge pull request #1917 from DefiLlama/migrate-univ2DimensionAdapter
dtmkeng Sep 17, 2024
dd7e9ee
wagmi
waynebruce0x Sep 17, 2024
465c531
migrate to v2
waynebruce0x Sep 17, 2024
76565bf
Merge pull request #1918 from DefiLlama/migrate
waynebruce0x Sep 17, 2024
f71c3fd
typus
waynebruce0x Sep 17, 2024
19ce30b
type
waynebruce0x Sep 17, 2024
29ae90a
Merge pull request #1919 from DefiLlama/migrate
waynebruce0x Sep 17, 2024
edf9fca
Merge pull request #1916 from SparkDEX/master
dtmkeng Sep 17, 2024
b8beed6
fix dragonswap-sei
dtmkeng Sep 17, 2024
770c24b
Merge pull request #1902 from dhedge/feat/fees-add-toros
dtmkeng Sep 17, 2024
332cc24
Merge pull request #1869 from dhedge/feat/add-flat-money
dtmkeng Sep 17, 2024
dc422a2
fix move to derivative ag
dtmkeng Sep 17, 2024
c385163
fix timestamp
literallymarvellous Sep 18, 2024
6743d14
feat: Adapter, MYX-Finance (fees)
fanjiachangRyan Sep 18, 2024
78f6943
get data
algtm Sep 18, 2024
3b8ca8e
fix pool fees logic
chanson-chan Sep 18, 2024
0107ce7
Update index.ts
chanson-chan Sep 18, 2024
325777c
Update index.ts
chanson-chan Sep 18, 2024
e443e01
Merge pull request #1921 from ryanfanjc/master
dtmkeng Sep 18, 2024
310cbbd
Merge pull request #1922 from avatarwallet/master
dtmkeng Sep 18, 2024
c2801b1
Merge branch 'DefiLlama:master' into master
buchaoqun Sep 18, 2024
d17068a
update deployed time
buchaoqun Sep 18, 2024
1420945
Merge branch 'master' of github.com:solv-finance-dev/dimension-adapters
buchaoqun Sep 18, 2024
c9b392e
Merge pull request #1924 from solv-finance-dev/master
dtmkeng Sep 18, 2024
f1de16d
Merge pull request #1920 from literallymarvellous/fix/pear-protocol
dtmkeng Sep 18, 2024
9b9db24
vfat: hack to reduce #event log calls
g1nt0ki Sep 18, 2024
be4f45b
hinkal-totalVolume
Dav0808 Sep 18, 2024
26ccd40
Add tondiamonds DEX aggregator volume adapter
shuva10v Sep 19, 2024
c6798ff
Uni v2 adapters refactor (#1925)
g1nt0ki Sep 19, 2024
3f2a939
ramses: fix bug
g1nt0ki Sep 19, 2024
edc72ea
Update dailyVolume methodolgy
Sep 19, 2024
3fdbd1b
add opbnb
algtm Sep 19, 2024
81bf2c8
remove unused code
g1nt0ki Sep 19, 2024
0c3dd80
Merge pull request #1928 from vspaxo/master
dtmkeng Sep 19, 2024
1d513d7
Merge pull request #1926 from re-doubt/feature/tondiamonds
dtmkeng Sep 19, 2024
2db43d5
refactor velodrome/aerodrome (#1930)
g1nt0ki Sep 19, 2024
3b89a3f
celodrome-v2: bugfix
g1nt0ki Sep 19, 2024
f10bcd5
fix version of adapter
dtmkeng Sep 19, 2024
807d4e5
add yellow router addresses
dimast-x Sep 20, 2024
c7f93bb
Merge pull request #1929 from avatarwallet/master
dtmkeng Sep 20, 2024
0def400
set id
dimast-x Sep 20, 2024
b8ffb7d
Merge pull request #1932 from layer-3/router/yellow
dtmkeng Sep 20, 2024
241a935
feat: add xy finance volume adapter
coolryanc Sep 19, 2024
f5ee5c8
adding adapter to display hinkal total volume
Dav0808 Sep 21, 2024
7c3bc71
add eth v3
dtmkeng Sep 21, 2024
5ba26ee
add polter base
whichghost Sep 21, 2024
cc03434
chore: move to bridge-aggregator
coolryanc Sep 21, 2024
b010de2
update ptoken address
whichghost Sep 21, 2024
c4d4585
add polter and replace token proxy
whichghost Sep 21, 2024
d1892cc
Merge pull request #1934 from whichghost/add-polter-base
dtmkeng Sep 21, 2024
4acc5b8
Merge pull request #1661 from Sharpelabs/main
dtmkeng Sep 22, 2024
35d3a7d
fix start tine and catch error
dtmkeng Sep 22, 2024
28dd9db
fix breakdown
dtmkeng Sep 22, 2024
59a5b79
update subgraph
0xBluePingu Sep 22, 2024
b867f38
Merge pull request #1935 from 0xBluePingu/master
dtmkeng Sep 23, 2024
02f9fc3
update wefi
g1nt0ki Sep 23, 2024
ca11651
Add adapter for Erinaceus VRF, add Bahamut network in chains list
erinaceus-labs Sep 23, 2024
aa335e1
fix add catch
dtmkeng Sep 23, 2024
8fb5796
remove total volume is stuck when run
dtmkeng Sep 23, 2024
452022a
fix dodo
dtmkeng Sep 23, 2024
c4280ee
fix remove not use
dtmkeng Sep 23, 2024
eef8b59
fix error
dtmkeng Sep 24, 2024
ec42eac
fix get date
dtmkeng Sep 24, 2024
e8b0a7a
update mux
g1nt0ki Sep 24, 2024
fad0614
update package version
g1nt0ki Sep 25, 2024
cd534d8
refactor maverick code
g1nt0ki Sep 25, 2024
2be23e5
cache block calls
g1nt0ki Sep 25, 2024
d8b617a
Add: Filament fees adapter
rajeebkm Sep 25, 2024
6653176
timestamp updated
rajeebkm Sep 25, 2024
2bc18b5
timestamp debugged
rajeebkm Sep 25, 2024
8ab3506
timestamp debugged
rajeebkm Sep 25, 2024
66490d4
timestamp debugged and removed redundant file
rajeebkm Sep 25, 2024
c1d615d
fees script updated
rajeebkm Sep 25, 2024
14b3549
timestamp debug
rajeebkm Sep 25, 2024
de067a4
refactor maverick code
g1nt0ki Sep 25, 2024
0479ebe
fix chain to eth
dtmkeng Sep 25, 2024
83508d0
feat: filament daily and total trading volume added
rajeebkm Sep 25, 2024
2efd4a1
volume script updated
rajeebkm Sep 25, 2024
9211717
fix dhedge
g1nt0ki Sep 26, 2024
3fa48bd
fix toros bug
g1nt0ki Sep 26, 2024
611f33f
dhege: add backup
g1nt0ki Sep 26, 2024
af188f8
code refactor
g1nt0ki Sep 26, 2024
7e05ba0
Merge pull request #1937 from erinaceus-labs/master
dtmkeng Sep 26, 2024
7410453
feat: add bifrost fees adapter
killbond007 Sep 26, 2024
d9ec426
fix error type check
dtmkeng Sep 27, 2024
8b0db34
Update index.ts
rajeebkm Sep 27, 2024
ab5556d
Merge pull request #1941 from FilamentFinance/master
dtmkeng Sep 27, 2024
3d918b1
Use Indexer's token transfer api
g1nt0ki Sep 27, 2024
aa8f4ff
add moonshot-money
dtmkeng Sep 27, 2024
515053d
Merge pull request #1944 from DefiLlama/moonshot-money
dtmkeng Sep 27, 2024
299124d
track bluemove dex
g1nt0ki Sep 27, 2024
e83bd14
Merge pull request #1942 from bifrost-finance/master
dtmkeng Sep 28, 2024
48b0529
add memedotcooking
Tarnadas Sep 27, 2024
0e561d8
Merge pull request #1933 from Dav0808/hinkal-volume
dtmkeng Sep 29, 2024
3bd0145
*added scribe exchange
suro-scribe Sep 30, 2024
572745b
ash-perp
waynebruce0x Sep 30, 2024
9a213b8
rollup
waynebruce0x Sep 30, 2024
4818266
Merge pull request #1946 from Shitzu-Apes/master
dtmkeng Sep 30, 2024
20ab908
equation
waynebruce0x Sep 30, 2024
ec6916f
equation
waynebruce0x Sep 30, 2024
24b3b20
Merge pull request #1950 from DefiLlama/30sept-patches
waynebruce0x Sep 30, 2024
a70bb7f
added ethereum and updated api url
mrben1 Sep 30, 2024
32fbc66
add h2-finance & h2-finance-v3
h2-finance-dev Oct 1, 2024
636024a
fix: Dexs subgraph for intentx
lemonpac Oct 1, 2024
189cc72
Add gTrade Base deployment
0xCrumb Oct 1, 2024
25c8539
fix adapter version
dtmkeng Oct 1, 2024
b468f56
Merge pull request #1752 from mrben1/master
dtmkeng Oct 1, 2024
f11b1b8
dexible
waynebruce0x Oct 1, 2024
3b34f7b
Merge pull request #1954 from DefiLlama/30sept-patches
waynebruce0x Oct 1, 2024
a4915b4
Add gTrade Base deployment (fees)
0xCrumb Oct 1, 2024
fd1b37f
Merge branch 'DefiLlama:master' into master
0xCrumb Oct 1, 2024
13b3043
Added handling for when the market does not exist
Leoakin43 Oct 1, 2024
9253d36
Merge branch 'DefiLlama:master' into master
Leoakin43 Oct 1, 2024
c561353
Merge pull request #1953 from Intent-X/master
dtmkeng Oct 1, 2024
d3e9c86
fix missing fees
dtmkeng Oct 1, 2024
f097562
fix trader joe v2
dtmkeng Oct 1, 2024
6243ed3
fix remove get block from code
dtmkeng Oct 1, 2024
f03d3fd
Merge pull request #1955 from GainsNetwork-org/master
dtmkeng Oct 1, 2024
7fa3e2c
Merge pull request #1931 from XY-Finance/feature/xy_finance_bridge-ag…
dtmkeng Oct 1, 2024
d755860
fix chain name
dtmkeng Oct 1, 2024
62d428e
rename
dtmkeng Oct 1, 2024
57ac7f8
add brigg
dtmkeng Oct 1, 2024
b03e408
fix chain name
dtmkeng Oct 1, 2024
892414f
fjord
waynebruce0x Oct 2, 2024
a799602
Merge pull request #1957 from DefiLlama/2oct-patches
waynebruce0x Oct 2, 2024
c43c8a3
code refactor
g1nt0ki Oct 2, 2024
4d97ce8
update endpoint base
0xpeluche Oct 2, 2024
e39d9c1
apeswap
waynebruce0x Oct 2, 2024
89dba8d
osmo fees
waynebruce0x Oct 2, 2024
7e65880
fix enable prerich-app
dtmkeng Oct 2, 2024
b16f68b
Merge pull request #1959 from DefiLlama/enable-prerich-app
dtmkeng Oct 2, 2024
ad875e4
Merge pull request #1958 from DefiLlama/uniswap-v3-base
dtmkeng Oct 2, 2024
a211e60
Merge pull request #1956 from Leoakin43/master
dtmkeng Oct 2, 2024
2cf3458
canto
waynebruce0x Oct 2, 2024
b055f39
arrakis
waynebruce0x Oct 2, 2024
412e8c1
liquid bolt
waynebruce0x Oct 2, 2024
9d6e2ca
Merge pull request #1960 from DefiLlama/2oct-patches
waynebruce0x Oct 2, 2024
5376a4b
polter
waynebruce0x Oct 2, 2024
291ec4f
is expensive adapter
0xngmi Oct 2, 2024
c5b9cc6
defiswap
waynebruce0x Oct 2, 2024
98bc79d
fwx dex
waynebruce0x Oct 2, 2024
ab38d1f
Merge pull request #1961 from DefiLlama/2oct-patches
waynebruce0x Oct 2, 2024
9e32a04
fix version
0xngmi Oct 2, 2024
a74ff0e
add okx
0xngmi Oct 2, 2024
4caa666
pcso
waynebruce0x Oct 3, 2024
fd56f38
jibswap
waynebruce0x Oct 3, 2024
1bbba94
v2
waynebruce0x Oct 3, 2024
db59223
Merge pull request #1962 from DefiLlama/2oct-patches
waynebruce0x Oct 3, 2024
cf93610
refactor looksrare
g1nt0ki Oct 3, 2024
09026ca
Merge pull request #1948 from scribe-dex/scribe-exchange-v4
dtmkeng Oct 3, 2024
db22ed5
Merge pull request #1952 from h2-finance-dev/master
dtmkeng Oct 3, 2024
72d1598
add harmony-swap
dtmkeng Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 12 additions & 7 deletions .github/workflows/commentResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@ async function main() {
const [_, adapterName] = adapterNameKey.split('@')


const errorString = '------ ERROR ------';
const summaryIndex = file.indexOf('_______________________________________');
const errorString = 'ERROR';
const summaryIndex = file.indexOf('---------------------------------------------------');
const errorIndex = file.indexOf(errorString);
let body;

if (summaryIndex != -1) {
body = `The ${adapterName} adapter exports:
\n \n ${file.substring(summaryIndex).replaceAll('\n', '\n ')}`;
body = `The ${adapterName} adapter exports:
\n \n ${file.replaceAll('\n', '\n ')}`;
console.info(`Posting comment:\n${body}`)
} else if (errorIndex != -1) {
body = `Error while running adapter ${adapterName} adapter:
body = `Error while running adapter ${adapterName} adapter:
\n \n ${file.split(errorString)[1].replaceAll('\n', '\n ')}`;
} else
console.info(`Posting comment:\n${body}`)
} else {
console.info(`No error or summary found in log file`);
return;
}


console.info(`Posting comment:\n${body}`)

Expand All @@ -37,4 +42,4 @@ async function main() {
function translate(input) {
return input ? translate(input.substring(1)) + input[0] : input;
};
main();
main();
4 changes: 2 additions & 2 deletions .github/workflows/getFileList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ALLOWED_ROOTS = ['volumes', 'dexs', 'options', 'derivatives', 'incentives', 'fees', 'options', 'protocols']
const ALLOWED_ROOTS = ['volumes', 'dexs', 'options', 'derivatives', 'incentives', 'fees', 'options', 'protocols', 'aggregators','aggregator-derivatives']
const MODIFIED = parse(process.env.MODIFIED)
const ADDED = parse(process.env.ADDED)
const fileSet = new Set();
Expand All @@ -13,4 +13,4 @@ console.log(JSON.stringify([...fileSet]))

function parse(data) {
return data.replace('[', '').replace(']', '').split(',')
}
}
20 changes: 14 additions & 6 deletions .github/workflows/test-adapter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ jobs:
uses: actions/checkout@v2
- name: Run changes files through test script
run: |
# Store the current commit hash in a variable
current_commit=$(git rev-parse HEAD)

# Checkout to master to check if new adapters files are of v2
git fetch origin master:master

# Checkout back to the original commit
git checkout $current_commit

RUN_FILES=$(
MODIFIED=${{ steps.file_changes.outputs.files_modified}} \
ADDED=${{ steps.file_changes.outputs.files_added}} \
Expand All @@ -24,21 +33,20 @@ jobs:
exit 0
fi

yarn install --production
yarn upgrade @defillama/sdk
npm ci

list=$(echo $RUN_FILES | tr -d '"[]' | tr "," "\n")

for i in ${list}
do
{
do
{
IFS='@' read -r -a array <<< "$i"
yarn test ${array[0]} ${array[1]} 2>&1 | tee output.txt
npm run test ${array[0]} ${array[1]} 2>&1 | tee output.txt
node ${{ github.workspace }}/.github/workflows/commentResult.js /home/runner/work/dimension-adapters/dimension-adapters/output.txt "${{ github.repository_owner }}" "${{ github.event.repository.name }}" "${{ github.event.number }}" ${i}
if grep -q "\-\-\-\- ERROR \-\-\-\-" output.txt; then
exit 1;
fi
} || {
} || {
echo -n $i
echo ' doesnt run'
}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ts-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn run update-submodules
- name: Get Node.js
uses: actions/setup-node@v1
with:
node-version: '16'
- run: yarn
- run: npm ci
- name: Checking adapters
run: yarn run ts-check
run: npm run ts-check
- name: Checking cli
run: yarn run ts-check-cli
run: npm run ts-check-cli
20 changes: 16 additions & 4 deletions adapters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export type IStartTimestamp = () => Promise<number>

export type BaseAdapter = {
[chain: string]: {
start: IStartTimestamp | number
fetch: Fetch|FetchV2;
start?: IStartTimestamp | number
fetch: Fetch | FetchV2;
runAtCurrTime?: boolean;
customBackfill?: Fetch;
customBackfill?: Fetch | FetchV2;
meta?: {
methodology?: string | IJSON<string>
hallmarks?: [number, string][]
Expand Down Expand Up @@ -119,6 +119,8 @@ export type FetchResultVolume = FetchResultBase & {
dailyShortOpenInterest?: FetchResponseValue
dailyLongOpenInterest?: FetchResponseValue
dailyOpenInterest?: FetchResponseValue
dailyBridgeVolume?: FetchResponseValue
totalBridgeVolume?: FetchResponseValue
};

// FEES
Expand Down Expand Up @@ -170,11 +172,21 @@ export enum AdapterType {
OPTIONS = 'options',
PROTOCOLS = 'protocols',
ROYALTIES = 'royalties',
AGGREGATOR_DERIVATIVES = 'aggregator-derivatives'
AGGREGATOR_DERIVATIVES = 'aggregator-derivatives',
BRIDGE_AGGREGATORS = 'bridge-aggregators',
}

export type FetchResult = FetchResultVolume & FetchResultFees & FetchResultAggregators & FetchResultOptions & FetchResultIncentives

export const whitelistedDimensionKeys = new Set([
'startTimestamp', 'chain', 'timestamp','block',

'dailyVolume', 'totalVolume', 'dailyShortOpenInterest', 'dailyLongOpenInterest', 'dailyOpenInterest', 'dailyBridgeVolume', 'totalBridgeVolume',
'totalFees', 'dailyFees', 'dailyUserFees', 'totalRevenue', 'dailyRevenue', 'dailyProtocolRevenue', 'dailyHoldersRevenue', 'dailySupplySideRevenue', 'totalProtocolRevenue', 'totalSupplySideRevenue', 'totalUserFees', 'dailyBribesRevenue', 'dailyTokenTaxes', 'totalHoldersRevenue',
'tokenIncentives',
'totalPremiumVolume', 'totalNotionalVolume', 'dailyPremiumVolume', 'dailyNotionalVolume',
])

// End of specific adaptors type

export interface IJSON<T> {
Expand Down
44 changes: 38 additions & 6 deletions adapters/utils/runAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { Balances, ChainApi, getEventLogs, getProvider } from '@defillama/sdk'
import { Balances, ChainApi, getEventLogs, getProvider, elastic } from '@defillama/sdk'
import { BaseAdapter, ChainBlocks, DISABLED_ADAPTER_KEY, Fetch, FetchGetLogsOptions, FetchOptions, FetchResultGeneric, FetchV2, } from '../types'
import { getBlock } from "../../helpers/getBlock";
import { getUniqStartOfTodayTimestamp } from '../../helpers/getUniSubgraphFees';

const ONE_DAY_IN_SECONDS = 60 * 60 * 24

function getUnixTimeNow() {
return Math.floor(Date.now() / 1000)
}

export default async function runAdapter(volumeAdapter: BaseAdapter, cleanCurrentDayTimestamp: number, chainBlocks: ChainBlocks, id?: string, version?: string, {
adapterVersion = 1
adapterVersion = 1,
isTest = false,
}: any = {}) {

const closeToCurrentTime = Math.trunc(Date.now() / 1000) - cleanCurrentDayTimestamp < 24 * 60 * 60 // 12 hours
const chains = Object.keys(volumeAdapter).filter(c => c !== DISABLED_ADAPTER_KEY)
const validStart = {} as {
Expand All @@ -18,9 +24,23 @@ export default async function runAdapter(volumeAdapter: BaseAdapter, cleanCurren
}
await Promise.all(chains.map(setChainValidStart))

return Promise.all(chains.filter(chain => validStart[chain]?.canRun).map(getChainResult))
const response = await Promise.all(chains.filter(chain => {
const res = validStart[chain]?.canRun
if (isTest && !res) console.log(`Skipping ${chain} because the configured start time is ${new Date(validStart[chain]?.startTimestamp * 1e3).toUTCString()} \n\n`)
return validStart[chain]?.canRun
}).map(getChainResult))
return response

async function getChainResult(chain: string) {
const startTime = getUnixTimeNow()
const metadata = {
application: "dimensions",
type: 'protocol-chain',
name: id,
chain,
version,
}

const fetchFunction = volumeAdapter[chain].customBackfill ?? volumeAdapter[chain].fetch
try {
const options = await getOptionsObject(cleanCurrentDayTimestamp, chain, chainBlocks)
Expand All @@ -47,19 +67,31 @@ export default async function runAdapter(volumeAdapter: BaseAdapter, cleanCurren
result[key] = +Number(result[key]).toFixed(0)
if (isNaN(result[key] as number)) throw new Error(`[${chain}]Value: ${value} ${key} is NaN`)
}

const endTime = getUnixTimeNow()
await elastic.addRuntimeLog({ runtime: endTime - startTime, success: true, metadata, })

return {
chain,
startTimestamp: validStart[chain].startTimestamp,
...result
}
} catch (error) {
try { (error as any).chain = chain } catch { }

const endTime = getUnixTimeNow()

try {
await elastic.addErrorLog({ error, metadata, errorString: error?.toString(), } as any)
await elastic.addRuntimeLog({ runtime: endTime - startTime, success: false, metadata, });

(error as any).chain = chain
} catch { }
throw error
}
}

async function getOptionsObject(timestamp: number, chain: string, chainBlocks: ChainBlocks): Promise<FetchOptions> {
const withinTwoHours = Math.trunc(Date.now() / 1000) - timestamp < 2 * 60 * 60 // 2 hours
const withinTwoHours = Math.trunc(Date.now() / 1000) - timestamp < 24 * 60 * 60 // 24 hours
const createBalances: () => Balances = () => {
return new Balances({ timestamp: closeToCurrentTime ? undefined : timestamp, chain })
}
Expand Down Expand Up @@ -88,7 +120,7 @@ export default async function runAdapter(volumeAdapter: BaseAdapter, cleanCurren
const api = new ChainApi({ chain, timestamp: withinTwoHours ? undefined : timestamp, block: toBlock })
const startOfDay = getUniqStartOfTodayTimestamp(new Date(toTimestamp * 1000))
const startTimestamp = fromTimestamp
const endTimestamp = toTimestamp
const endTimestamp = toTimestamp + 1
const getStartBlock = getFromBlock
const getEndBlock = getToBlock
const toApi = api
Expand Down
Empty file added aggregator-derivatives/.gitkeep
Empty file.
55 changes: 55 additions & 0 deletions aggregator-derivatives/bitoro/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import fetchURL from "../../utils/fetchURL";
import { FetchResult, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";

const BitoroX_BASE_URL = "https://min-api.bitoro.network/btr/stats/global";
const BitoroPro_BASE_URL = "https://min-api.inj.bitoro.network/stats/global";
const startTimestamp_bitoro_x = 1711324800; // 2024-03-25 00:00:00
const startTimestamp_bitoro_pro = 1718323200; // 2024-06-14 00:00:00

const getBitoroXUrl = (startTime: number, endTime: number): string => {
return `${BitoroX_BASE_URL}?start=${startTime}&end=${endTime}`;
}

const getBitoroProUrl = (startTime: number, endTime: number): string => {
return `${BitoroPro_BASE_URL}?start=${startTime}&end=${endTime}`;
}

const fetchBitoroX = async (_:any, _b:any ,options: any): Promise<FetchResult> => {
const { endTimestamp, startTimestamp } = options;
const dailyVolume = await fetchURL(getBitoroXUrl(startTimestamp, endTimestamp));
const totalVolume = await fetchURL(getBitoroXUrl(startTimestamp_bitoro_x, endTimestamp));

return {
timestamp: startTimestamp,
dailyVolume: dailyVolume.volume || 0,
totalVolume: totalVolume.volume || 0,
};
};

const fetchBitoroPro = async (_:any, _b:any ,options: any): Promise<FetchResult> => {
const { fromTimestamp, toTimestamp } = options;
const dailyVolume = await fetchURL(getBitoroProUrl(fromTimestamp, toTimestamp));
const totalVolume = await fetchURL(getBitoroProUrl(startTimestamp_bitoro_pro, toTimestamp));

return {
timestamp: fromTimestamp,
dailyVolume: dailyVolume.volume || 0,
totalVolume: totalVolume.volume || 0,
};
};

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.ARBITRUM]: {
fetch: fetchBitoroX,
start: startTimestamp_bitoro_x
},
[CHAIN.INJECTIVE]: {
fetch: fetchBitoroPro,
start: startTimestamp_bitoro_pro
}
}
}

export default adapter;
Loading