Earn API

The Earn Application Programmatic Interface is an industry standards compliant service that provides easy access to our main data for use by 'bots, partners, systems and sophisticated users who code.

The API can be found in different locations depending on the Earn Liquidity Pool for which you want data.

The Earn Verified pool's data can be seen here ...

The Earn Open pool's data can be seen here ...

Both APIs use the "Restful paradigm", as well as Swagger to document the end points and explain how to call them. There is also a convenient interface to make HTTP calls to the API directly in the page.

The data the API uses consist of 4 collections in a DB. These are

  1. Markets

  2. History

  3. Accounts

  4. Liquidation

For each there are POST, GET, PUT and PATCH behaviors. Only GET behaviors are available to the public. In addition to the 16 "CRUD" methods that you would expect in a restful API with 4 entities, there is also support for 3 special end points. These are

  1. My Rewards

  2. Interest

  3. Average APY

These can be used to learn the amount of ALK rewards or how much interest an account earned over a period of time, or what the prevailing APYs were for a market over that period.

Last updated