Metadata-Version: 2.4
Name: tribulnation-risex
Version: 0.1.0
Summary: Tribulnation SDK implementation for RISEx perpetuals.
License-Expression: MIT
Project-URL: Repository, https://github.com/tribulnation/sdk.git
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tribulnation-sdk>=4.1.0
Requires-Dist: typed-risex>=0.1.1
Dynamic: license-file

# RISEx SDK

Perpetual Market and Report support for [RISEx](https://rise.trade/), built on
`typed-risex`. Install with `pip install tribulnation-risex`.

```python
from tribulnation.risex import RisexMarket

async with RisexMarket.new() as venue:
  perp = await venue.perp_exchange('perp')
  market = await perp.market('1')  # BTC/USDC
  book = await market.depth(levels=5)
```

RISEx has no API keys. Every account read is public, keyed by the account's address; a
registered signer (session) key signs orders and cancels:

```python
venue = RisexMarket.new(address='0x…')  # account reads only
venue = RisexMarket.new(address='0x…', signer_key='0x…', network='testnet')  # trading
```

The environment is never read here; `MarketSDK` resolves `RISEX_ADDRESS`,
`RISEX_ACCOUNT_KEY` and `RISEX_SIGNER_KEY` (`RISEX_TESTNET_*` for `risex_testnet`).

1. One exchange, `perp`. Market ids are the venue's numeric `market_id` (`'1'` is
   BTC/USDC on both networks); the collateral, fee and funding asset is `USDC`.
2. Public data: discovery, tickers (last price and quote volume), rules, depth, a shared
   book stream, candles in the six SDK intervals, index, `perp_stats`, the funding
   estimate and hourly funding-rate history.
3. Account and trading: order queries, open orders, trade history, positions,
   collateral, leverage and available notional by address; `fees` with a key; the fills
   stream, `MARKET` (an IOC limit), `LIMIT` and `POST_ONLY` orders and every
   cancellation method with the signer key. Placements are mined before the venue
   replies; refusals raise `OrderRejected`.
4. Isolated positions raise `NotImplementedError` from collateral reads and snapshots.

`Report` snapshots one account by address:

```python
from tribulnation.risex import Report

async with Report.new(address='0x…') as report:
  record = await report.snapshot()
```

See [RISEx Market](../../../docs/market/implementations/risex.md) for account
configuration through `MarketSDK` and venue-specific semantics.
