### Installing Dependencies (npm) Source: https://github.com/splashprotocol/defillama-adapters/blob/main/projects/clearpool/readme.md Runs the npm install command with the `-f` flag to force dependency installation. ```Shell 4. run \`npm i -f\` to install dependencies. ``` -------------------------------- ### Querying DefiLlama Info (GraphQL) Source: https://github.com/splashprotocol/defillama-adapters/blob/main/projects/clearpool/readme.md Provides an example GraphQL query to fetch `poolFactory` and `protocol` information from the `defillamaInfo` field. ```GraphQL 2. Query \`defillamaInfo\`\n\nex. query MyQuery {\n defillamaInfo {\n poolFactory\n protocol\n }\n} ``` -------------------------------- ### Testing DefiLlama Adapters (Bash) Source: https://github.com/splashprotocol/defillama-adapters/blob/main/README.md This snippet demonstrates how to run adapter tests locally using the `node test.js` command, including options to test against the latest data or a specific historical timestamp or date. ```bash node test.js projects/pangolin/index.js # Add a timestamp at the end to run the adapter at a historical timestamp node test.js projects/aave/v3.js 1729080692 # or using YYYY-MM-DD node test.js projects/aave/v3.js 2024-10-16 ``` -------------------------------- ### Testing Liquidation Adapter - Bash Source: https://github.com/splashprotocol/defillama-adapters/blob/main/liquidations/README.md This Bash command is used to test a specific liquidation adapter locally within the repository. It executes the test script located at ./liquidations/test.ts using ts-node and passes the path to the adapter's index file as an argument. Replace with the directory name of the adapter you wish to test. ```Bash npx ts-node ./liquidations/test.ts ./liquidations//index.ts ``` -------------------------------- ### Running Test Script (Node.js) Source: https://github.com/splashprotocol/defillama-adapters/blob/main/projects/clearpool/readme.md Executes a specific test script using Node.js, targeting the clearpool project index file. ```Shell 5. run \`node test.js projects/clearpool/index.js\` to test. ``` -------------------------------- ### Accessing GraphQL Endpoint Source: https://github.com/splashprotocol/defillama-adapters/blob/main/projects/clearpool/readme.md Instructs the user to open the Subsquid GraphQL endpoint in a browser to interact with the API. ```Shell 1. Open https://squid.subsquid.io/cpool-squid/v/v1/graphql on browser ``` -------------------------------- ### Configuring RPC Providers (Environment Variables) Source: https://github.com/splashprotocol/defillama-adapters/blob/main/README.md This snippet shows how to override the default RPC providers used by the adapters by creating an `.env` file and specifying chain-specific RPC URLs using the `{CHAIN-NAME}_RPC` format. ```text ETHEREUM_RPC="..." BSC_RPC="..." POLYGON_RPC="..." ``` -------------------------------- ### Defining Liquidation Adapter Interface - TypeScript Source: https://github.com/splashprotocol/defillama-adapters/blob/main/liquidations/README.md This TypeScript code defines the interfaces for a liquidation level adapter. The `LiquidationAdapter` interface specifies that an adapter is an object mapping chain names to an object containing a `liquidations` function. The `Liq` interface defines the structure of a single liquidatable position, including owner, liquidation price, collateral details, and optional extra information. ```TypeScript interface LiquidationAdapter { // chain name [chain: string]: { liquidations: () => Promise; }; } interface Liq { owner: string; // owner of this liquidatable position liqPrice: number; // liquidation price in USD collateral: string; // collateral asset address with prefix, eg `ethereum:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` collateralAmount: string; // native, non-decimal adjusted token amount, eg 1 ETH will be "1000000000000000000" extra?: { displayName?: string; // name of owner to be displayed on positions inspector url: string; // link to "spy" inspector provided by the protocol, or blockchain explorer }; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.