|
| 1 | +# Vesper API documentation |
| 2 | + |
| 3 | +## Endpoints |
| 4 | + |
| 5 | +[`[GET] /dashboard`](https://api.vesper.finance/dashboard) |
| 6 | + |
| 7 | +Gets additional information such as contracts, strategies and pool rewards from all pools. |
| 8 | +Returns an array with the requested data: |
| 9 | +- `name`(`string`): the name of the pool |
| 10 | +- `contract` (`object`): pool contract information. |
| 11 | + - `address` (`string`): pool contract address. |
| 12 | + - `tokens`: (`object[]`): list of tokens from the contract. |
| 13 | + - `holders` (`number`): number of holders from the pool. |
| 14 | +- `strategies` (`object[]`): list of pool strategies information such as address, tokens, pool rewards, status and stage. |
| 15 | + - `address` (`string`): pool strategy address. |
| 16 | + - `tokens`: (`object[]`): list of tokens information from strategy. |
| 17 | + - `makerVaultInfo` (`object | undefined`): information on the MakerDAO Vault as applicable. |
| 18 | +- `strategy` (`object`): [Deprecated] pool strategy information such as address, tokens, pool rewards, status and stage. |
| 19 | + - `address` (`string`): pool strategy address. |
| 20 | + - `tokens`: (`object[]`): list of tokens information from strategy. |
| 21 | + - `makerVaultInfo` (`object | undefined`): information on the MakerDAO Vault as applicable. |
| 22 | +- `poolRewards` (`object`): pool rewards information. |
| 23 | + - `address` (`string`): pool rewards address. |
| 24 | + - `tokens` (`object[]`) list of pool tokens |
| 25 | +- `status` (`string`): pool status. It can be "operative", "paused". |
| 26 | +- `stage` (`string`): stage the pool is currently on. It can be "alpha", "beta", "prod" or "retired". |
| 27 | + |
| 28 | +Example: |
| 29 | +```js |
| 30 | +[{ |
| 31 | + name: "vLINK", |
| 32 | + contract: { |
| 33 | + address: "0x0a27E910Aee974D05000e05eab8a4b8Ebd93D40C", |
| 34 | + tokens: [ |
| 35 | + { |
| 36 | + address: "0x514910771af9ca656af840dff83e8264ecf986ca", |
| 37 | + balance: "3563537237796219000000000", |
| 38 | + decimals: "18", |
| 39 | + symbol: "LINK" |
| 40 | + } |
| 41 | + ], |
| 42 | + holders: 239 |
| 43 | + }, |
| 44 | + strategies: [ |
| 45 | + { |
| 46 | + address: "0x59543A595B69897b295F12964d3C7C37B3AD29C0", |
| 47 | + tokens: [ |
| 48 | + { |
| 49 | + address: "0x6b175474e89094c44da98b954eedeac495271d0f", |
| 50 | + balance: "10141625", |
| 51 | + decimals: "18", |
| 52 | + symbol: "DAI" |
| 53 | + }, |
| 54 | + { |
| 55 | + address: "0xca0c34a3f35520b9490c1d58b35a19ab64014d80", |
| 56 | + balance: "825661980228538300000", |
| 57 | + decimals: "18", |
| 58 | + symbol: "vDAI" |
| 59 | + } |
| 60 | + ], |
| 61 | + makerVaultInfo: { |
| 62 | + collateralRatio: "0", |
| 63 | + daiDebt: "0", |
| 64 | + highWater: "3000000000000000000", |
| 65 | + isUnderwater: false, |
| 66 | + lowWater: "2750000000000000000", |
| 67 | + vaultNum: "23254" |
| 68 | + } |
| 69 | + } |
| 70 | + ], |
| 71 | + strategy: { |
| 72 | + address: "0x59543A595B69897b295F12964d3C7C37B3AD29C0", |
| 73 | + tokens: [ |
| 74 | + { |
| 75 | + address: "0x6b175474e89094c44da98b954eedeac495271d0f", |
| 76 | + balance: "10141625", |
| 77 | + decimals: "18", |
| 78 | + symbol: "DAI" |
| 79 | + }, |
| 80 | + { |
| 81 | + address: "0xca0c34a3f35520b9490c1d58b35a19ab64014d80", |
| 82 | + balance: "825661980228538300000", |
| 83 | + decimals: "18", |
| 84 | + symbol: "vDAI" |
| 85 | + } |
| 86 | + ], |
| 87 | + makerVaultInfo: { |
| 88 | + collateralRatio: "0", |
| 89 | + daiDebt: "0", |
| 90 | + highWater: "3000000000000000000", |
| 91 | + isUnderwater: false, |
| 92 | + lowWater: "2750000000000000000", |
| 93 | + vaultNum: "23254" |
| 94 | + } |
| 95 | + }, |
| 96 | + poolRewards: { |
| 97 | + address: "0xcA9AEeB14ff396F8661F7DF3128f88c31D2fDEC5", |
| 98 | + tokens: [ |
| 99 | + { |
| 100 | + address: "0x1b40183efb4dd766f11bda7a7c3ad8982e998421", |
| 101 | + balance: "4643799953696691000000", |
| 102 | + decimals: "18", |
| 103 | + symbol: "VSP" |
| 104 | + } |
| 105 | + ] |
| 106 | + }, |
| 107 | + status: "operative", |
| 108 | + stage: "prod" |
| 109 | +}] |
| 110 | +``` |
| 111 | + |
| 112 | +[`[GET] /loan-rates`](https://api.vesper.finance/loan-rates) |
| 113 | + |
| 114 | +Gets the APY, APR and token symbol from all pools. |
| 115 | +Returns an object with the key `lendRates` that contains an array with the requested data from each pool. |
| 116 | +- `apy` (`number`): annual percentage yield calculated over the last 24h. |
| 117 | +- `apr` (`number`): annual percentage rate calculated over the last 24h. |
| 118 | +- `tokenSymbol` (`string`): token symbol. |
| 119 | + |
| 120 | +Example: |
| 121 | +```js |
| 122 | +{ |
| 123 | + lendRates: [ |
| 124 | + { |
| 125 | + apy: 0.0415, |
| 126 | + apr: 0.0407, |
| 127 | + tokenSymbol: "DAI" |
| 128 | + }, |
| 129 | + { |
| 130 | + apy: 0.0057, |
| 131 | + apr: 0.0057, |
| 132 | + tokenSymbol: "ETH" |
| 133 | + }, |
| 134 | + { |
| 135 | + apy: 0.0024, |
| 136 | + apr: 0.0024, |
| 137 | + tokenSymbol: "LINK" |
| 138 | + }, |
| 139 | + { |
| 140 | + apy: 0.0196, |
| 141 | + apr: 0.0194, |
| 142 | + tokenSymbol: "USDC" |
| 143 | + }, |
| 144 | + { |
| 145 | + apy: 12.9642, |
| 146 | + apr: 2.646, |
| 147 | + tokenSymbol: "VSP" |
| 148 | + }, |
| 149 | + { |
| 150 | + apy: 0.0143, |
| 151 | + apr: 0.0142, |
| 152 | + tokenSymbol: "WBTC" |
| 153 | + } |
| 154 | + ] |
| 155 | +} |
| 156 | +``` |
| 157 | + |
| 158 | +[`[GET] /pools`](https://api.vesper.finance/pools) |
| 159 | + |
| 160 | +Gets detailed information from all pools. |
| 161 | +Returns an array with the requested data. |
| 162 | +- `name` (`string`): name of the pool. |
| 163 | +- `address` (`string`): address of the pool. |
| 164 | +- `asset` (`object`): asset compounding the pool. |
| 165 | + - `address` (`string`): asset address. |
| 166 | + - `decimals` (`string`): pool asset decimals quantity. |
| 167 | + - `symbol` (`string`): asset symbol. |
| 168 | + - `currency` (`string`): asset currency. |
| 169 | + - `price` (`number`): asset price. |
| 170 | +- `birthblock` (`number`): the block at which the pool contract was created. |
| 171 | +- `chainId` (`number`): the id of the chain where the contract was deployed. |
| 172 | +- `riskLevel` (`number`): shows the risk level of the pool. More than 3 is considered aggressive, 3 or less is conservative. |
| 173 | +- `stage` (`string`): stage the pool is currently on. It can be "alpha", "beta", "prod" or "retired". |
| 174 | +- `collRewardsRate` (`string`): collateral rewards rate. |
| 175 | +- `decimals` (`string`): pool decimals quantity. |
| 176 | +- `interestEarned` (`string`): interest earned from the pool. |
| 177 | +- `interestFee` (`number`): interest fee that it is charged. It is set to 15% for every pool except vVSP which is 0. |
| 178 | +- `lockPeriod` (`number`): time (expresed in seconds) where the user can't do a withdraw. It is set to 0 for every pool except for vVSP which is 24 hours (86400 seconds). |
| 179 | +- `status` (`string`): pool status. It can be "operative", "paused". |
| 180 | +- `tokenValue` (`string`): pool token value. |
| 181 | +- `totalSupply` (`string`): pool total supply. |
| 182 | +- `totalValue` (`string`): pool total value. |
| 183 | +- `vspRewards` (`boolean`): flag used to know if pool gives rewards. |
| 184 | +- `vspRewardsRate` (`string`): VSP rewards rate. |
| 185 | +- `withdrawFee` (`number`): withdraw fee charged. It is set to 0.60% for every pool except vVSP which is 0. |
| 186 | +- `color` (`string`): color (in hex) used to represent a pool, for example in a chart. |
| 187 | +- `holders` (`number`): number of holders from a pool. |
| 188 | +- `isRetiring` (`boolean`): flag used to know if a pool is in the process of retiring. |
| 189 | +- `actualRates` (`object`): pool actual rates from 1, 2, 7 and 30 days. |
| 190 | +- `earningRates` (`object`): pool earning rates from 1, 2, 7 and 30 days. |
| 191 | +- `vspDeltaRates` (`object`): VSP delta rates from 1, 2, 7 and 30 days. |
| 192 | + |
| 193 | +Example: |
| 194 | +```js |
| 195 | +[{ |
| 196 | + name: "vDAI", |
| 197 | + address: "0xcA0c34A3F35520B9490C1d58b35A19AB64014D80", |
| 198 | + asset: { |
| 199 | + address: "0x6B175474E89094C44Da98b954EedeAC495271d0F", |
| 200 | + decimals: "18", |
| 201 | + symbol: "DAI", |
| 202 | + currency: "USD", |
| 203 | + price: 1.0006 |
| 204 | + }, |
| 205 | + birthblock: 11594191, |
| 206 | + chainId: 1, |
| 207 | + riskLevel: 3, |
| 208 | + stage: "prod", |
| 209 | + collRewardsRate: "0", |
| 210 | + decimals: "18", |
| 211 | + interestEarned: "0", |
| 212 | + interestFee: 0.15, |
| 213 | + lockPeriod: 0, |
| 214 | + status: "operative", |
| 215 | + tokenValue: "1031290356976276280", |
| 216 | + totalSupply: "257324418187703220979612", |
| 217 | + totalValue: "265376191091509055419337", |
| 218 | + vspRewards: false, |
| 219 | + vspRewardsRate: "0", |
| 220 | + withdrawFee: 0.006, |
| 221 | + color: "#c7c3e8", |
| 222 | + holders: 90, |
| 223 | + isRetiring: false, |
| 224 | + actualRates: { |
| 225 | + 1: 4.15, |
| 226 | + 2: 4.46, |
| 227 | + 7: 4.62, |
| 228 | + 30: 6.88 |
| 229 | + }, |
| 230 | + earningRates: { |
| 231 | + 1: 4.15, |
| 232 | + 2: 4.46, |
| 233 | + 7: 4.62, |
| 234 | + 30: 6.88 |
| 235 | + }, |
| 236 | + vspDeltaRates: { |
| 237 | + 1: 0, |
| 238 | + 2: 0, |
| 239 | + 7: 0, |
| 240 | + 30: 0 |
| 241 | + } |
| 242 | +}] |
| 243 | +``` |
| 244 | + |
| 245 | +`[GET] /pools/:address/data-points` |
| 246 | + |
| 247 | +Gets data points such as values, supplies, interest and interest fee from the specified pool within the last week. |
| 248 | +Returns an array with the requested data. |
| 249 | +- `number` (`number`): the block number where the values were taking from. |
| 250 | +- `interest` (`string`): interest given from the specified pool. |
| 251 | +- `interestFee` (`number`): interest fee that it's charged. It is set to 15% for every pool except vVSP which is 0. |
| 252 | +- `supply` (`string`): pool supply from which the data point is from. |
| 253 | +- `timestamp` (`number`): date and time (in seconds) from which the data point is from. |
| 254 | +- `value` (`string`): pool value from which the data point is from. |
| 255 | + |
| 256 | +Example: |
| 257 | +```js |
| 258 | +[{ |
| 259 | + number: 12477605, |
| 260 | + interest: "503509373321162311", |
| 261 | + interestFee: 0.15, |
| 262 | + supply: "126482280705011577917580", |
| 263 | + timestamp: 1621599093, |
| 264 | + value: "1003979119015679467" |
| 265 | +}] |
| 266 | +``` |
| 267 | + |
| 268 | +[`[GET] /values-locked`](https://api.vesper.finance/values-locked) |
| 269 | + |
| 270 | +Gets deposits asset values from all pools within the last month. |
| 271 | +Returns an array with the requested data. |
| 272 | +- `_id` (`string`): random ID. |
| 273 | +- `number` (`number`): the block number where the values were taking from. |
| 274 | +- `timestamp` (`number`): date and time (in seconds) in which the data comes from. |
| 275 | +- `valuesLocked` (`object`): list of pools by address |
| 276 | + - `{{poolAddress}}` (`string`): total value locked from the pool within the `timestamp` |
| 277 | + |
| 278 | +Example: |
| 279 | +```js |
| 280 | +[{ |
| 281 | + _id: "60897a1d03dc1669cf6beec6", |
| 282 | + number: 12329593, |
| 283 | + timestamp: 1619621673, |
| 284 | + valuesLocked: { |
| 285 | + 0x0a27E910Aee974D05000e05eab8a4b8Ebd93D40C: "145249765884", |
| 286 | + 0xbA4cFE5741b357FA371b506e5db0774aBFeCf8Fc: "76310599903590", |
| 287 | + 0xcA0c34A3F35520B9490C1d58b35A19AB64014D80: "340903766941", |
| 288 | + 0x0C49066C0808Ee8c673553B7cbd99BCC9ABf113d: "236672858664861", |
| 289 | + 0x4B2e76EbBc9f2923d83F5FBDe695D8733db1a17B: "405713119147682", |
| 290 | + 0x103cc17C2B1586e5Cd9BaD308690bCd0BBe54D5e: "554270079439720" |
| 291 | + } |
| 292 | +}] |
| 293 | +``` |
| 294 | + |
| 295 | +[`[GET] /vsp-stats`](https://api.vesper.finance/vsp-stats) |
| 296 | + |
| 297 | +Gets information related to the VSP token, such as price, total and circulating supply, market cap and more. |
| 298 | +Returns an `object` with the requested data. |
| 299 | +- `price` (`number`): last VSP token price. |
| 300 | +- `priceChange1h` (`number`): VSP token price change within the last hour. |
| 301 | +- `priceDelta1h` (`number`): VSP token price delta change within the last hour. |
| 302 | +- `totalSupply` (`string`): VSP token total supply. |
| 303 | +- `circulatingSupply` (`string`): VSP token circulating supply. |
| 304 | +- `marketCap` (`number`): VSP token market cap. |
| 305 | +- `vspDistributed` (`string`): VSP tokens distributed. |
| 306 | +- `vspDistributed30d` (`string`): VSP tokens distributed within 30 days. |
| 307 | + |
| 308 | +Example: |
| 309 | +```js |
| 310 | +{ |
| 311 | + price: 17.530217, |
| 312 | + priceChange1h: 0, |
| 313 | + priceDelta1h: -0.136685, |
| 314 | + totalSupply: "10000000000000000000000000", |
| 315 | + circulatingSupply: "3513992153784838601048611", |
| 316 | + marketCap: 61601044.99, |
| 317 | + vspDistributed: "16986395824456057293201", |
| 318 | + vspDistributed30d: "184549654243772215145896" |
| 319 | +} |
| 320 | +``` |
0 commit comments