Lendasat LogoLendasat Docs
API ReferenceLender API

Lender API

Complete API documentation for Lendasat Lender integration

Version: 0.8.11 Specification: OAS 3.1 Base URL: https://apilend.lendasat.com

The Lendasat Lender API allows you to programmatically interact with the platform to:

  • Register as a new lender
  • Manage personal API keys
  • Create and manage loan offers
  • Monitor lending positions
  • Track returns and performance
  • Handle contract settlements

Authentication

All API requests require authentication using an API key passed in the request header:

x-api-key: your-api-key-here

How to Get an API Key as a Regular Lender

For the time being, you will need to contact Lendasat support to request an API key.

Steps:

  1. Register at the Lendasat lending platform
  2. Email support@lendasat.com to request an API key
  3. Use the provided API key in all API requests

How to Create Lender API Accounts

Lendasat partners and institutional lenders can create lender API accounts to integrate Lendasat directly into their own products or automated lending strategies.

Partner Integration Steps

1. Register as a Partner

Register as a regular lender on the Lendasat platform.

2. Request Master API Key

Contact Lendasat support to generate a master API key for your organization.

3. Create Lender API Accounts

Use your master API key to create new lender accounts programmatically:

curl -X POST "https://apilend.lendasat.com/api/create-api-account" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-master-key" \
  -d '{
    "name": "Institution Name",
    "email": "lender@institution.com",
    "timezone": "Europe/London"
  }' | jq .

Response:

{
  "id": "918416ea-7cbd-42e7-bc92-7b5e2fd82e4c",
  "name": "Institution Name",
  "email": "lender@institution.com",
  "timezone": "Europe/London",
  "api_key": "ldst-lend-2e017736-175c-5d72-cc4b-52f608532g4g"
}

The returned api_key can be used to interact with Lendasat's Lender API.


Example Usage of Lender API Key

Once you have a lender API key, you can use it to create loan offers:

curl -X POST "https://apilend.lendasat.com/api/offers" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ldst-lend-2e017736-175c-5d72-cc4b-52f608532g4g" \
  -d '{
    "loan_amount": 1000,
    "interest_rate": 12.5,
    "duration_days": 30,
    "min_ltv": 50,
    "max_ltv": 70,
    "token": "USDC",
    "network": "Polygon"
  }' | jq .

API Endpoints

The Lender API provides the following endpoint groups:

Detailed endpoint documentation will be added as individual pages. Check back soon or contact support for the complete API specification.

Account Management

  • Create API accounts (partner feature)
  • Manage API keys
  • User registration

Loan Offers

  • Create new loan offers
  • Update existing offers
  • Pause/activate offers
  • Query offer performance
  • Delete offers

Portfolio Management

  • View active lending positions
  • Monitor contract performance
  • Track interest earned
  • View liquidation events
  • Portfolio analytics

Contract Management

  • Accept contract requests
  • Monitor contract status
  • Handle repayments
  • Manage liquidations
  • Track collateral value

Notifications

  • Webhook configuration
  • Event subscriptions
  • Repayment alerts
  • Liquidation notifications

Request Format

All POST/PUT requests must use Content-Type: application/json.

Example Request:

{
  "loan_amount": 1000,
  "interest_rate": 12.5,
  "duration_days": 30,
  "min_ltv": 50,
  "max_ltv": 70,
  "token": "USDC",
  "network": "Polygon",
  "auto_accept": true
}

Response Format

All responses are returned in JSON format.

Success Response:

{
  "id": "660f9511-f39c-52e5-b827-557766551111",
  "status": "active",
  "loan_amount": 1000,
  "interest_rate": 12.5,
  "duration_days": 30,
  "created_at": "2024-01-15T10:30:00Z"
}

Error Response:

{
  "error": "Invalid interest rate",
  "code": "INVALID_RATE",
  "details": "Interest rate must be between 1% and 50%"
}

Error Handling

Common HTTP Status Codes:

CodeDescription
200Success
201Created
400Bad Request (invalid parameters)
401Unauthorized (invalid/missing key)
404Not Found
429Too Many Requests (rate limited)
500Internal Server Error

Best Practices
  1. Secure API Keys - Never expose API keys in client-side code or public repositories
  2. Risk Management - Set appropriate LTV ratios to minimize liquidation risk
  3. Diversification - Spread offers across different amounts and durations
  4. Monitor Positions - Regularly check contract status and collateral values
  5. Webhook Integration - Use webhooks for real-time notifications
  6. Rate Limiting - Implement exponential backoff for rate limit responses

Automated Lending Strategies

The Lender API is designed to support automated lending strategies:

Strategy Examples:

  • Conservative: Low LTV (50-60%), higher interest rates, shorter durations
  • Balanced: Medium LTV (60-70%), moderate rates, varied durations
  • Aggressive: Higher LTV (70-80%), competitive rates, longer durations

Implementation:

# Create multiple offers with different risk profiles
curl -X POST "https://apilend.lendasat.com/api/offers/bulk" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "offers": [
      {"amount": 500, "rate": 15, "duration_days": 7, "max_ltv": 60},
      {"amount": 1000, "rate": 12, "duration_days": 14, "max_ltv": 65},
      {"amount": 2000, "rate": 10, "duration_days": 30, "max_ltv": 70}
    ]
  }'

Development vs Production

Development:

  • Base URL: Contact support for development endpoint
  • Test API keys available
  • No real funds involved

Production:

  • Base URL: https://apilend.lendasat.com
  • Production API keys required
  • Real stablecoins and returns

Support & Resources

Next Steps