mirror of
https://github.com/uniwhale-io/DefiLlama-yield-server.git
synced 2026-01-12 08:53:45 +08:00
This reverts commit cebb4539ac.
This commit is contained in:
4
.github/workflows/getFileList.js
vendored
4
.github/workflows/getFileList.js
vendored
@@ -8,9 +8,7 @@ const fileSet = new Set();
|
||||
root0 === 'src' &&
|
||||
root1 === 'adaptors' &&
|
||||
dir !== 'test.js' &&
|
||||
dir !== 'utils.js' &&
|
||||
dir !== 'package.json' &&
|
||||
dir !== 'package-lock.json'
|
||||
dir !== 'utils.js'
|
||||
)
|
||||
fileSet.add(dir);
|
||||
});
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
2. Fork this repository
|
||||
3. Create a new folder within [src/adaptors/](src/adaptors/) with your protocol name (use your project `slug` from `https://api.llama.fi/protocols`)
|
||||
4. Write an adaptor for your protocol (tutorial below)
|
||||
5. `cd src/adaptors` and run `npm i`
|
||||
6. Test your adaptor by running `npm run test --adapter=YOUR_ADAPTER`
|
||||
7. Submit a PR
|
||||
5. Test your adaptor by running `npm run test --adapter=YOUR_ADAPTER` (remember to install dependencies with `npm i` first!)
|
||||
6. Submit a PR
|
||||
|
||||
### Data sources
|
||||
|
||||
@@ -64,7 +63,6 @@ A note on how to set apy related fields:
|
||||
```
|
||||
|
||||
#### FAQ
|
||||
|
||||
> Why are some pools missing on DefiLlama which appear on my adapter?
|
||||
|
||||
DefiLlama only displays pools with >10k TVL, so pools with less TVL than that will appear on the adapter but not on defillama
|
||||
|
||||
@@ -6,10 +6,8 @@ module.exports = function () {
|
||||
} else {
|
||||
console.log('\nSample pools:', global.apy.slice(0, 10));
|
||||
}
|
||||
if (global.apy.some((p) => p.tvlUsd < 10e3)) {
|
||||
console.log(
|
||||
"This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama"
|
||||
);
|
||||
if(global.apy.some(p=>p.tvlUsd<10e3)){
|
||||
console.log("This adapters contains some pools with <10k TVL, these pools won't be shown in DefiLlama")
|
||||
}
|
||||
process.exit(0);
|
||||
};
|
||||
@@ -3,7 +3,7 @@ const axios = require('axios');
|
||||
const fs = require('fs');
|
||||
|
||||
module.exports = async function () {
|
||||
require('dotenv').config({ path: '../../config.env' });
|
||||
require('dotenv').config({ path: './config.env' });
|
||||
|
||||
const adapter = process.env.npm_config_adapter;
|
||||
const timestamp = process.env.npm_config_timestamp;
|
||||
@@ -13,11 +13,7 @@ module.exports = async function () {
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const cwd = process.cwd();
|
||||
const passedFile = cwd.includes('src/adaptors')
|
||||
? path.resolve(cwd, adapter)
|
||||
: path.resolve(cwd, `./src/adaptors/${adapter}`);
|
||||
const passedFile = path.resolve(process.cwd(), `./src/adaptors/${adapter}`);
|
||||
const module = require(passedFile);
|
||||
|
||||
global.adapter = adapter;
|
||||
@@ -60,7 +60,7 @@
|
||||
"webpack": "^5.70.0"
|
||||
},
|
||||
"jest": {
|
||||
"globalSetup": "./src/adaptors/beforeTests.js",
|
||||
"globalTeardown": "./src/adaptors/afterTests.js"
|
||||
"globalSetup": "./beforeTests.js",
|
||||
"globalTeardown": "./afterTests.js"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ const fs = require('fs');
|
||||
function main(){
|
||||
const adapters = fs
|
||||
.readdirSync('./src/adaptors')
|
||||
.filter((el) => !el.includes('js') && el !== '.DS_Store' && !el.includes('package')).map(t=>`"${t}"`).join(",")
|
||||
.filter((el) => !el.includes('js') && el !== '.DS_Store').map(t=>`"${t}"`).join(",")
|
||||
fs.writeFileSync("./src/adaptors/list.js", "module.exports = [" + adapters + "]")
|
||||
}
|
||||
|
||||
|
||||
21350
src/adaptors/package-lock.json
generated
21350
src/adaptors/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,36 +0,0 @@
|
||||
{
|
||||
"name": "defillama-apy-adapters",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@defillama/sdk": "^2.3.126",
|
||||
"@types/jest": "^28.1.6",
|
||||
"@uniswap/sdk-core": "^3.0.1",
|
||||
"@uniswap/smart-order-router": "^2.8.0",
|
||||
"async-retry": "^1.3.3",
|
||||
"axios": "^0.27.2",
|
||||
"bignumber.js": "^9.0.2",
|
||||
"csv-writer": "^1.6.0",
|
||||
"date-fns": "^2.23.0",
|
||||
"dotenv": "^10.0.0",
|
||||
"graphql": "^15.5.1",
|
||||
"graphql-request": "^3.5.0",
|
||||
"lodash": "^4.17.21",
|
||||
"node-fetch": "^2.6.1",
|
||||
"superagent": "^6.1.0",
|
||||
"web3": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "^28.1.3",
|
||||
"prettier": "^2.2.1",
|
||||
"ts-node": "^10.9.1"
|
||||
},
|
||||
"jest": {
|
||||
"globalSetup": "./beforeTests.js",
|
||||
"globalTeardown": "./afterTests.js"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user