Skip to content

Instantly share code, notes, and snippets.

@frostiq
Last active July 31, 2021 20:53
Show Gist options
  • Save frostiq/4bfa6326c4647aecc8fd9c787ebbf1f9 to your computer and use it in GitHub Desktop.
Save frostiq/4bfa6326c4647aecc8fd9c787ebbf1f9 to your computer and use it in GitHub Desktop.
LoanScan interest rates ingestion API spec
Interest rates ingestion endpoint is a HTTP GET endpoint available via https protocol
e.g. "https://example.com/rates?api-key=XXXXXXXXXXX"
If this endpoint requires an API key, it should be accepted as a query string parameter, HTTP headers are not supported
The response should be a JSON object that corresponds to the following example:
{
    "lendRates": [
        {
            "apy": 0.0100005, // Annual Percentage Yield, multiplier format
            "apr": 0.01, // Annual Percentage Rate, multiplier format
            "tokenSymbol": "ETH" // a symbol of listed currency (3 or 4 capital letters)
        },
        ...
    ],
    "borrowRates": [
        {
            "apy": 0.07202,
            "apr": 0.072,
            "tokenSymbol": "DAI"
        },
        ...
    ]
}
Either "lendRates" or "borrowRates" should be a non-empty array.
APR and APY should be specified in a multiplier format (e.g. specify 0.15 for 15% APR).
You can find more info about APR and APY relation here: https://mindyourdecisions.com/blog/apr-to-apy-converter/
Supported currencies: 'USDC', 'SAI', 'DAI', 'ETH', 'BTC', 'WBTC', 'XRP', 'USD', 'TUSD', 'BUSD', 'GUSD', 'PAX', 'USDT','ZRX','BAT','REP','MKR','LTC','EOS','ZEC','BCH','DASH','XLM'.
Other currencies in the response are not supported and will be ignored.
All three fields ("apy", "apr", "tokenSymbol") are required for every object in "lendRates" and "borrowRates" arrays.
@frostiq
Copy link
Author

frostiq commented Nov 19, 2020

Hi, could you add Celsius Network? Thank's

We have some issues with Celsius API, going to sort them out in the nearest future.

@frostiq
Copy link
Author

frostiq commented Nov 19, 2020

            "apy": 0.0100005,    // Annual Percentage Rate, multiplier format
            "apr": 0.01,         // Annual Percentage Yield, multiplier format

the comments are inverted ;-)

Thanks for noticing that! Comments updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment