Skip to content

Latest commit

 

History

History
262 lines (197 loc) · 5.66 KB

endpoints.md

File metadata and controls

262 lines (197 loc) · 5.66 KB

Table of Contents

List of Endpoints

Base is always: https://api.curve.fi/

Last generation time of an endpoint can be found in the generatedTimeMs property.

getPools

Retrieves all pools for any registry on any chain where Curve is deployed.

GET /api/getPools/<blockchainId>/<registryId>

Parameters:

  • blockchainId: blockchain id where Curve pools are deployed
  • registryId: registry id where Curve pools are deployed ('main'|'crypto'|'factory'|'factory-crypto')

View:

This is the list of all deployed registries on all chains, as of June 14, 2023

This endpoint returns all pools from all these registries, in exactly the same shape, except for the fact that each pool object will also contain a blockchainId prop. For each pool object in the endpoints above, the id prop is unique. For each pool object in this single "all pools" endpoint, the combination of props blockchainId and id is unique.

getETHprice

GET /api/getETHprice

Current Ethereum price used to calculate gas price

View: getETHprice

Parameters: NONE

Response :

"data": {
   "price": 1826.11, //price of Ethereum in USD
   "generatedTimeMs": 1615380294701 //when the response was generated
}

getFactoryTVL

GET /api/getFactoryTVL

Returns factory TVL excluding LP tokens (which are already counted in the main Curve TVL.

View: getFactoryTVL

Parameters: NONE

Response :

"data": {
  "factoryBalances": 139264023, //factory balances in USD
  "generatedTimeMs": 1615381415356
}

getRegistryAddress

GET /api/getRegistryAddress

Returns registry address which is subject to change.

View: getRegistryAddress

Parameters: NONE

Response :

"data": {
  "registryAddress": "0x7D86446dDb609eD0F5f8684AcF30380a356b2B4c",
  "generatedTimeMs": 1615381483925
}

getTVL

GET /api/getTVL

Returns Curve TVL

View: getTVL

Parameters: NONE

Response :

"data": {
  "tvl": 3961187920.275839, //total tvl excluding the factory
  "usdTVL": 1761657547.966614, //stable tvl
  "ethTVL": {
    "native": 393332.35772124684, //number of eth
    "usd": 730209722.1387632, //amount of eth in usd
    "asset": "ethereum"
  },
}

getTVLFantom

GET /api/getTVLFantom

Returns TVL on Fantom

View: getTVLFantom

Parameters: NONE

Response :

"data": {
  "tvl": 11283973.12937601,
  "generatedTimeMs": 1620458596596
}

getTVLPolygon

GET /api/getTVLPolygon

Returns TVL on Polygon

View: getTVLPolygon

Parameters: NONE

Response :

"data": {
  "tvl": 11283973.12937601,
  "generatedTimeMs": 1620458596596
}

getWeeklyFees

GET /api/getWeeklyFees

Returns weekly fees distributed to veCRV holders.

View: getWeeklyFees

Parameters: NONE

Response :

"data": {
  "weeklyFeesTable": [
    {
      "date": "Thu Mar 04 2021",
      "ts": 1614816000000, //timestamp of epoch start
      "rawFees": 23928.77840856761 //fees for the week in USD
    }

getApys

Note: deprecated on June 11, 2022; data is old and incomplete, please use other endpoints

GET /api/getApys
GET /api/getApys?address=0xADDRESS

Returns all types of APYs for all Curve pools (base APY from trading fees, CRV APY from CRV distribution, and any additional rewards the pool may have)

View: getApys

Parameters:

  • address (optional): address to use to calculate CRV boosts and APYs; if no address is provided, the baseline boost value (1) is used

Response :

"data": {
  "apys": {
    "saave": {
      "baseApy": "2.21",
      "crvApy": 4.430468225441863,
      "crvBoost":1,
      "additionalRewards": [
        { "name": "STKAAVE", "apy": 0.6132910288661984 }
      ],
      "crvPrice": 1.38
    },
    …
  }
}