Skip to main content

Lending

The Partner API exposes Democratized Prime lending endpoints so you can register as a lender, create and exit offers, and view earnings. Full request/response details are in the Partner API OpenAPI spec — Lending.

note

By registering as a lender or creating offers, you agree to the applicable terms. Consent to the Democratized Prime terms (PDF) is required.

Public (unauthenticated) lending pool data is in the Public API — Lending; we do not duplicate that here.


How Democratized Prime offers work

A Democratized Prime offer is an offer to lend a specified amount at a target rate into a specific leverage pool. The rate you specify is a target — it does not guarantee that your offer will be filled.

  • Matching: Every hour a Dutch auction runs. Lender supply (offers) is sorted by rate and date, then allocated against borrowing demand. Your offer may be fully filled, partially filled, or unfilled for that period.
  • Interest: If your offer is not filled for a given period, you do not accrue interest for that period.
  • YLDS exception: For YLDS pool offers, amounts not lent out still earn interest to the lender during the usual distribution periods (once a month), even when not lent out.

Request sequence

Call the endpoints in this order when building a lending flow:

StepActionRequest
1Register as a lender (one-time)POST /api/v1/lenders
2Create an offerPOST /api/v1/lenders/offer
3List or inspect offersGET /api/v1/lenders/offer or GET /api/v1/lenders/offer/{offerId}
4Exit an offer (when desired)POST /api/v1/lenders/offer/{offerId}/exit
5View earningsGET /api/v1/lenders/earnings-history and/or GET /api/v1/lenders/earnings-history/total

Steps 3–5 can be repeated; step 4 is optional and only when you want to exit. The leveragePoolId(s) returned in step 1 are those available to the user given their market location. For leverage pool details (e.g. pool metadata, rates), use the Public API — Lending endpoints; we do not duplicate those here.


1. Register as a lender (one-time)

You must register before creating offers. Do this once per account.

Register as a lender: POST /api/v1/lenders

No body required. Returns lender id, leverage pool ids (those available to the user given their market location), and status. You must have consented to the Democratized Prime terms (PDF) before calling. Use the returned leveragePoolId values when creating offers and querying earnings. For leverage pool details (e.g. pool name, collateral, terms), use the Public API — Lending endpoints.


2. Create an offer

Commit funds to a leverage pool at a target rate. The rate is your minimum acceptable rate; fill is determined each period by the auction (see How Democratized Prime offers work).

Create an offer: POST /api/v1/lenders/offer

Body: id (unique, idempotent), rate, amount, leveragePoolId. The amount field is in decimal (e.g. 1000 = 1000 units of the pool asset). Funds are committed to the pool; the portion that is matched each period earns at the clearing rate for that period.

Example body:

{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"rate": 0.05,
"amount": 1000,
"leveragePoolId": "3229a80e-6400-4afe-a15e-c4b4652ff574"
}

3. Manage offers

Get all offers: GET /api/v1/lenders/offer

Optional query: page, size, status.

Fetch offer by id: GET /api/v1/lenders/offer/{offerId}

Returns a single offer by offerId.

Exit an offer: POST /api/v1/lenders/offer/{offerId}/exit

Call when you want to exit an offer. No body required. If there is not enough liquidity in the pool to return funds immediately, your exit request is queued together with all other exits in that pool (in order); funds are returned when liquidity becomes available.


4. Earnings

Earnings history: GET /api/v1/lenders/earnings-history

Required query: leverage_pool_id. Optional: period, page, size.

24h and lifetime earnings: GET /api/v1/lenders/earnings-history/total

Required query: leverage_pool_id.


For full request/response schemas and any additional endpoints, see the Lending spec.