Skip to content

Commit

Permalink
Merge branch 'DefiLlama:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
NatureLab authored Nov 15, 2023
2 parents 0e86d50 + e9636ff commit cb08c0f
Show file tree
Hide file tree
Showing 2,187 changed files with 43,959 additions and 23,591 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
"rules": {
"no-case-declarations": "off",
"no-unused-vars": "off",
"no-useless-escape": "warn",
"no-prototype-builtins": "off",
}
}
4 changes: 2 additions & 2 deletions .github/workflows/alert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
- uses: actions/checkout@v2
- name: Update unlisted
run: curl https://born-to-llama.herokuapp.com/refresh
- name: Deploy to server
run: curl https://born-to-llama.herokuapp.com/rebuild-server
# - name: Deploy to server
# run: curl https://born-to-llama.herokuapp.com/rebuild-server
4 changes: 2 additions & 2 deletions .github/workflows/getFileList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ const fileSet = new Set();

[...MODIFIED, ...ADDED].forEach(file => {
const [root, dir] = file.split('/')
if (dir === 'treasury') fileSet.add(file)
if (dir === 'treasury' || dir === 'entities') fileSet.add(file)
else if (root === 'projects' && dir !=='helper' && dir !== 'config') fileSet.add(root + '/' + dir)
})

console.log(JSON.stringify([...fileSet]))

function parse(data) {
return data.replace('[', '').replace(']', '').split(',')
}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ historical-data.js
/.idea
yarn.lock
.DS_Store
projects/pooltogether/index.js
.vscode
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ Follow [this guide](https://docs.llama.fi/submit-a-project) to create an adapter

Also, don't hesitate to send a message on [our discord](https://discord.defillama.com/) if we're late to merge your PR.

> If you would like to add a `volume` adapter please submit the PR [here](https://github.com/DefiLlama/adapters).
> If you would like to add a `volume` adapter please submit the PR [here](https://github.com/DefiLlama/adapters)
> - If you would like to add a `liquidations` adapter, please refer to [this readme document](https://github.com/DefiLlama/DefiLlama-Adapters/tree/main/liquidations) for details.
1. Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.
2. Please enable "Allow edits by maintainers" while putting up the PR.
3. Sorry, We no longer accept fetch adapter for new projects, we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
4. **For updating listing info** It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data2.ts, you can edit it there and put up a PR
5. Do not edit/push `package-lock.json` file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CI
6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap

## Getting listed

Expand All @@ -27,11 +35,9 @@ If you want to change RPC providers because you need archive node access or beca
ETHEREUM_RPC="..."
BSC_RPC="..."
POLYGON_RPC="..."
FANTOM_RPC="..."
ARBITRUM_RPC="..."
OPTIMISM_RPC="..."
XDAI_RPC="..."
HARMONY_RPC="..."
```

The name of each rpc is `{CHAIN-NAME}_RPC`, and the name we use for each chain can be found [here](https://github.com/DefiLlama/defillama-sdk/blob/master/src/providers.json)

## Adapter rules
- Never add extra npm packages, if you need a chain-level package for your chain, ask us and we'll consider it, but we can't accept any npm package that is project-specific
20 changes: 10 additions & 10 deletions liquidations/mimo-protocol/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ const latestRoundDataABI = {
enum Chain {
ethereum = "ethereum",
polygon = "polygon",
fantom = "fantom",
// fantom = "fantom",
}

const getEURUSD = async (chain: Chain) => {
const oracleAddresses = {
[Chain.ethereum]: "0xb49f677943bc038e9857d61e7d053caa2c1734c1",
[Chain.polygon]: "0x73366fe0aa0ded304479862808e02506fe556a98",
[Chain.fantom]: "0x3e68e68ea2c3698400465e3104843597690ae0f7",
// [Chain.fantom]: "0x3e68e68ea2c3698400465e3104843597690ae0f7",
};

const eurUSDRoundData = await sdk.api.abi.call({
Expand All @@ -56,11 +56,11 @@ const getSubgraphUrl = (chain: Chain) => {
subgraphUrl = "https://api.thegraph.com/subgraphs/name/m19/titanpolygon";
break;
}
case Chain.fantom: {
subgraphUrl =
"https://api.thegraph.com/subgraphs/name/rayxpub/titanfantom";
break;
}
// case Chain.fantom: {
// subgraphUrl =
// "https://api.thegraph.com/subgraphs/name/rayxpub/titanfantom";
// break;
// }
}

return subgraphUrl;
Expand Down Expand Up @@ -194,7 +194,7 @@ module.exports = {
polygon: {
liquidations: positions(Chain.polygon),
},
fantom: {
liquidations: positions(Chain.fantom),
},
// fantom: {
// liquidations: positions(Chain.fantom),
// },
};
22 changes: 22 additions & 0 deletions liquidations/navi/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Liq } from "../utils/types";
import axios from "axios";

const liquidations = async () => {
const info = await axios.get("https://api-defi.naviprotocol.io/estimateLiquidateUser");

return info.data.map(
({ owner, liqPrice, collateral, collateralAmount }) =>
({
owner,
liqPrice,
collateral,
collateralAmount,
} as Liq)
);
};

module.exports = {
sui: {
liquidations,
},
};
Loading

0 comments on commit cb08c0f

Please sign in to comment.