Compound v2 REST API - Permanent Shut Down

The Compound v2 REST API (api.compound.finance) for reading structured data is being permanently shut down on April 15th, 2023.

All of the data returned from this API is publicly available as read-only data from the Ethereum blockchain.

To access the source of the data, you can do so using a node provider with history enabled, from a firm like alchemy.com or infura.io. These third-party providers have a free usage tier for users with minimal API usage.

The Compound v2 protocol will continue to run on the Ethereum blockchain unless otherwise changed through community governance. Users are encouraged to migrate from Compound v2 to v3 however no action is required in relation to the REST API shut down.

The v2 Dapp at v2-app.compound.finance no longer needs the API as a dependency. The Dapp is open source, community maintained, and will continue to be available after the API shut down.

6 Likes

How would we replace the API exactly? I’m a bit confused about how to get the same values the API provided for available cTokens and their properties (including exchange rate, borrow limit, etc.) and collaterals/borrows held by an address. I only find bits and pieces in the docs which means it would take several hundred calls to a provider like Infura plus a lot of calculation and stitching-together instead of 2 API calls as before, which doesn’t seem practical (or cost-effective, given that updating every few minutes would quickly deplete Infura credits this way, if hundreds of calls are needed for every update).

Am I missing something?

EDIT: Or is there maybe a GitHub repo with the old API so that I can run the API on my own server? I didn’t find any…

I see your discord message. Let’s continue correspondence there.

I have the same question and no one from compound gives any guidance.

1 Like

Hi Adam,

I am looking for historic supply and borrow rates of cUSDCv3, cWETHv3, cDAIv2, cETHv2, cUSDCv2, cWBTCv2, and cUSDT? Is there any way to retrieve these information without the REST API?

Some information are available on the Ethereum blockchain, but I could not find rates in transaction logs. Is there a way to gather or infer these information.

Thank you!

1 Like

You can get the supply or borrow rate at any block height using JSON RPC and an archive node. Compound v2 Docs | cTokens

Calculation of the APY or APR can be found based on the returned integer. Compound v2 Documentation

2 Likes