Skip to content

LP getting started

Step-by-step checklist for liquidity providers. All examples use https://api.rampwire.app.

Important: In every /api/lp/{id}/… URL, {id} is your lp_key (e.g. lp_a1b2c3d4), not the numeric lp_id returned from registration. The same value must appear in Authorization: Bearer ….


1. Register as an LP

POST /api/lp/register (no auth)

Registers a user and liquidity provider row and returns your secret lp_key.

Example request

bash
curl -sS -X POST 'https://api.rampwire.app/api/lp/register' \
  -H 'Content-Type: application/json' \
  -d '{
    "display_name": "Nairobi OTC Desk",
    "xrpl_address": "rN4M2UExampleXrpAddress9Rampwire",
    "mpesa_phone": "254712345678",
    "supported_currencies": { "KES": 128.9, "NGN": 1545 },
    "spread_bps": 200
  }'

Example response (201)

json
{
  "lp_id": 12,
  "lp_key": "lp_a1b2c3d4",
  "user_id": 9001
}

Save lp_key immediately; it is not shown again by the API.

Field notes

  • xrpl_address, mpesa_phone: required strings (validated at registration).
  • supported_currencies: optional map of currency code → rate_usd inserted into lp_rates (see step 3).
  • spread_bps: optional basis-points spread (default in app code is 200 if omitted).

2. Your lp_key — keep it secret

  • Use it as Authorization: Bearer lp_… on every authenticated LP request.
  • It is also the path parameter for /api/lp/{lp_key}/… routes (must match the bearer token).
  • Treat it like a password: never commit it, log it in client-side web apps, or put it in mobile apps shipped to users.

3. Set your rates

POST /api/lp/{lp_key}/rates

Body:

FieldMeaning
currencyFiat code, e.g. KES, NGN.
rate_usdHow many units of local currency equal 1 USD (e.g. 128.9 means 1 USD = 128.9 KES).
bash
export LP_KEY='lp_a1b2c3d4'

curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/rates" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{"currency":"KES","rate_usd":128.9}'

Response: {"ok":true}


4. Add crypto addresses (where you receive crypto)

POST /api/lp/{lp_key}/assets

bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/assets" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{
    "symbol": "USDT",
    "chain": "trx",
    "address": "TXYZExampleTronReceiveAddressRampwire42"
  }'

Use symbols and chains your integration actually uses (e.g. USDT + trx, XRP + xrpl).


5. Deposit collateral

POST /api/lp/{lp_key}/collateral/deposit

bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/collateral/deposit" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{
    "amount": 500,
    "asset": "XRP",
    "tx_hash": "ABC123exampleLedgerTxHash"
  }'

asset defaults to "XRP" if omitted; tx_hash is optional but useful for ops.

Confirm a pending collateral row (when applicable):

bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/collateral/123/confirm" \
  -H "Authorization: Bearer ${LP_KEY}" \
  -H "Content-Type: application/json" \
  -d '{}'

(Replace 123 with the real lp_collateral id from your ledger or admin tooling.)


WebSocket (recommended for automation)
Connect to:

wss://api.rampwire.app/ws/orders?lp_key={lp_key}&currencies=KES,NGN

You receive init with recent open orders and new_order as they are created. See LP WebSocket automation for message types, heartbeats, and code samples.

Long poll
GET /api/lp/{lp_key}/orders/stream

bash
curl -sS "https://api.rampwire.app/api/lp/${LP_KEY}/orders/stream?currencies=KES&since=2026-05-01T00:00:00.000Z" \
  -H "Authorization: Bearer ${LP_KEY}"

Response includes orders, count, and poll_again_ms (typically 2000). Call again after the suggested delay.


7. Claim an order

POST /api/orders/{order_id}/claim

Use your LP bearer token (path is the numeric order id, not the lp_key).

bash
export ORDER_ID=10042

curl -sS -X POST "https://api.rampwire.app/api/orders/${ORDER_ID}/claim" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{}'

Successful claim returns status, lp_receive_address, and collateral_locked. This is the canonical way to claim (collateral lock + receive address).


8. Mark fiat sent

POST /api/orders/{order_id}/fiat-sent

After you send M-Pesa (or other fiat) to the user’s recipient:

bash
curl -sS -X POST "https://api.rampwire.app/api/orders/${ORDER_ID}/fiat-sent" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{}'

9. Receive crypto — wait for completion

The retail user confirms fiat and submits their on-chain tx. Your job is to watch the order (dashboard, GET /api/orders/{id}, or webhooks if you also run an agent integration) until status reaches a terminal state (completed, cancelled, disputed, etc.). You receive crypto at the address you configured in step 4.

Optional: upload a receipt before or when marking fiat:

bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/receipt" \
  -H "Authorization: Bearer ${LP_KEY}" \
  -F "order_id=${ORDER_ID}" \
  -F "file=@/path/to/mpesa_confirmation.pdf"

See LP API reference for response fields.


10. Dashboard

GET /api/lp/{lp_key}/dashboard

bash
curl -sS "https://api.rampwire.app/api/lp/${LP_KEY}/dashboard" \
  -H "Authorization: Bearer ${LP_KEY}"

Returns LP profile row, rates, assets, recent open_orders (unclaimed), and my_orders.


Next steps

Rampwire — fiat–crypto infrastructure