Skip to content

options_new_trade returns INTERNAL_SERVER_ERROR on mainnet for valid instrument #23

@johnongit

Description

@johnongit

Summary

When attempting to create an options trade via the Python SDK, the call to options_new_trade consistently returns:

{ "message": "Internal error", "code": "INTERNAL_SERVER_ERROR" }

Other options endpoints (market, instruments, trades, volatility index, etc.) work fine.

Environment

  • SDK: ln-markets Python SDK (latest from PyPI)
  • Network: mainnet
  • Python: 3.12.9
  • OS: Pop OS 22.04

Steps to Reproduce

  1. Install the latest ln-markets Python SDK from PyPI.
  2. Initialize the REST client on mainnet.
  3. Call options_new_trade with the parameters below.

Minimal Code Sample

from lnmarkets import Rest

lnm = Rest(
    key="...",
    secret="...",
    passphrase="...",
    network="mainnet",
)

resp = lnm.options_new_trade(
    side="b",
    quantity=1,
    settlement="cash",
    instrument_name="BTC.2025-12-26.50000.C",
)

print(resp)

Request Payload

{
  "side": "b",
  "quantity": 1,
  "settlement": "cash",
  "instrument_name": "BTC.2025-12-26.50000.C"
}

Expected Behavior

Trade should be created successfully (or a clear validation error should be returned if the payload is invalid).

Actual Behavior

{
  "message": "Internal error",
  "code": "INTERNAL_SERVER_ERROR"
}

What I’ve Tried

  • Confirmed instrumentName uses camelCase.
  • Verified options_get_market reports active: true.
  • Verified the instrument exists via options_get_instruments.
  • Tried several instruments from the returned list.
  • Other options endpoints (get market, get instruments, my trades, volatility index) all work.

Notes

  • Using the smallest possible quantity and cash settlement to be safe.
  • This looks like either an API-side issue or an undocumented requirement for options_new_trade.

Workarounds

None found.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions