Skip to content

Instantly share code, notes, and snippets.

@BlockmanCodes
BlockmanCodes / .env
Created April 10, 2022 19:23
Get spot prices on Uniswap
INFURA_URL=<your_url>
ETHERSCAN_API_KEY=<your_api_key>
@ajb413
ajb413 / Get_COMP_APY.md
Last active August 8, 2023 11:03
Finding the COMP APY

From Blockchain With JSON RPC and JavaScript

const Compound = require('@compound-finance/compound-js');

const provider = 'https://mainnet.infura.io/v3/' + process.env.infuraApiKey;

const cTokenToGetCompApy = Compound.cUSDC; // Pick an asset

const underlying = cTokenToGetCompApy.slice(1, 10);
const underlyingDecimals = Compound.decimals[underlying];