Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save sambacha/e1505c3fa5311f9bf01c93d4c3cc31da to your computer and use it in GitHub Desktop.

Select an option

Save sambacha/e1505c3fa5311f9bf01c93d4c3cc31da 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 Rate, multiplier format
            "apr": 0.01, // Annual Percentage Yield, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment