Skip to main content

nubra_flexi_payload

nubra_flexi_payload is a small builder for dynamic Nubra flexi basket payloads.

The goal is to let a user define multi-leg option strategies in a simple format, resolve the correct instruments from the instrument master, calculate quantities from lot sizes, and generate a ready-to-send trade.flexi_order(...) payload without doing the repetitive symbol, expiry, quantity, and pricing calculations manually.

It is designed for flexible strategy construction across different underlyings and exchanges, while keeping Nubra SDK initialization outside the package. The package also builds an aggressive basket limit price so the flexi basket behaves like a marketable order and gets placed seamlessly.

Install

pip install nubra-flexi-payload

Public API

  • build_option_strategy(...)
  • build_flexi_payload(...)
  • quote_fetcher_factory(md_instance)

What It Handles

  • Build grouped strategy input from a single underlying and multiple option legs
  • Resolve correct option instruments from a preloaded instrument master
  • Support relative expiry inputs like week0, week1, week2, week3, and month
  • Calculate per-leg quantity from instrument lot size and requested lots
  • Build the final trade.flexi_order(...) payload
  • Set an aggressive basket limit price so the flexi order gets placed without extra strategy-premium calculations from the user

Usage

from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.refdata.instruments import InstrumentData
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
from nubra_python_sdk.trading.trading_data import NubraTrader
from nubra_python_sdk.trading.trading_enum import DeliveryTypeEnum, ExchangeEnum

from nubra_flexi_payload import build_option_strategy, build_flexi_payload, quote_fetcher_factory

nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True)
instruments = InstrumentData(nubra)
md = MarketData(nubra)
trade = NubraTrader(nubra, version="V2")

symbols = build_option_strategy(
    underlying="NIFTY",
    legs=[
        [23500, "PE", "week0", "SELL", 1],
        [23900, "CE", "week0", "SELL", 1],
    ],
)

payload = build_flexi_payload(
    symbols=symbols,
    instruments_df=instruments.get_instruments_dataframe(exchange="NSE"),
    quote_fetcher=quote_fetcher_factory(md),
    basket_name="AutoBuiltFlexiStrategy",
    tag="auto_entry",
    exchange=ExchangeEnum.NSE,
    multiplier=3,
    order_delivery_type=DeliveryTypeEnum.ORDER_DELIVERY_TYPE_CNC,
    limit_buffer_paise=500,
)

trade.flexi_order(payload)

Leg Input

Each leg can be passed as either:

  • [strike, option_type, expiry_type, side, lots]
  • {"strike": 302.5, "option_type": "PE", "expiry_type": "week1", "side": "BUY", "lots": 1}

Supported expiry_type values:

  • week0: current or nearest live expiry
  • week1: next expiry after week0
  • week2: next expiry after week1
  • week3: next expiry after week2
  • month: current month's monthly expiry

If a requested weekly expiry is not available for that underlying, the module falls back to the current month's monthly expiry.

Metadata

Release files for nubra-flexi-payload 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nubra-flexi-payload 0.1.2
File Size Uploaded Provenance Actions
nubra_flexi_payload-0.1.2.tar.gz 6.0 kB Without provenance Details for nubra_flexi_payload-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nubra-flexi-payload 0.1.2
File Interpreter ABI Platform Actions
nubra_flexi_payload-0.1.2-py3-none-any.whl Python 3 none any Details for nubra_flexi_payload-0.1.2-py3-none-any.whl

Total release size: 12.5 kB

Release files / nubra_flexi_payload-0.1.2.tar.gz

Download URL nubra_flexi_payload-0.1.2.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bc065f20926f061fd95284edea10286b23db02604e3c301597d93ba458f1ccd8
BLAKE2b-256 checksum
How to use checksums
d8d483251d505c5dcd76ee5020e4a2f4baa43a1e85d50ff43723c3cf06a8519d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Release files / nubra_flexi_payload-0.1.2-py3-none-any.whl

Download URL nubra_flexi_payload-0.1.2-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe88ba3731860a49844b96e57fcf136ad9d0dbbd2c4c1d03e7de4f4708a77372
BLAKE2b-256 checksum
How to use checksums
8029562a52b4115d649a0bf123ba866affb618aa6fcd238feaea0689b14eb2f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Security for nubra-flexi-payload 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page