Link Exchange Account
Link an exchange trading account to a dealer as a liquidity provider.
Endpoint
POST /api/v3/fermata/dealer/link
Description
Links an existing exchange trading account to a dealer. The linked account serves as a liquidity provider (LP) for automatic hedging. A dealer must have at least one linked exchange account before it can generate quotes.
Admin only.
Authentication
Requires Bearer token authentication with admin role.
Authorization: Bearer {access_token}
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
dealerAccountId | string | Yes | Dealer account ID |
tradingAccountId | string | Yes | Exchange trading account ID to link as LP |
Response
Returns a simple success response.
Usage
import requests
headers = {"Authorization": f"Bearer {access_token}"}
response = requests.post(
"https://cadenza-api.algo724.com/api/v3/fermata/dealer/link",
headers=headers,
json={
"dealerAccountId": "550e8400-e29b-41d4-a716-446655440000",
"tradingAccountId": "660e8400-e29b-41d4-a716-446655440001"
}
)
print(response.json())
curl -X POST https://cadenza-api.algo724.com/api/v3/fermata/dealer/link \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"dealerAccountId": "550e8400-e29b-41d4-a716-446655440000",
"tradingAccountId": "660e8400-e29b-41d4-a716-446655440001"
}'
Example Response
{
"data": "ok",
"success": true,
"errno": 0,
"error": null
}
Error Responses
| HTTP Code | Error | Description |
|---|---|---|
| 400 | Invalid request | Missing parameters or account already linked |
| 401 | Unauthorized | Invalid or expired access token |
| 403 | Forbidden | Requires admin role |
| 404 | Not found | Dealer or trading account not found |
Example Error
{
"data": null,
"success": false,
"errno": -130007,
"error": "Trading account is already linked to this dealer"
}
Notes
- The trading account must be an exchange account (not a Fermata account)
- The trading account must be in ACTIVE status
- Linking creates an exchange wallet (
exchange:{tradingAccountId}) in the Formance Ledger to track net flow - Use
fermata.dealer.unlinkto remove the link