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-hereHow 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:
- Register at the Lendasat lending platform
- Email support@lendasat.com to request an API key
- 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:
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request (invalid parameters) |
| 401 | Unauthorized (invalid/missing key) |
| 404 | Not Found |
| 429 | Too Many Requests (rate limited) |
| 500 | Internal Server Error |
Best Practices
- Secure API Keys - Never expose API keys in client-side code or public repositories
- Risk Management - Set appropriate LTV ratios to minimize liquidation risk
- Diversification - Spread offers across different amounts and durations
- Monitor Positions - Regularly check contract status and collateral values
- Webhook Integration - Use webhooks for real-time notifications
- 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
- Support Email: support@lendasat.com
- OpenAPI Spec: Download JSON
- Platform Docs: Lending Guide
- Contract Terms: Contract Details
Next Steps
- Explore individual endpoint documentation (coming soon)
- Borrower API Overview
- Contract State Management