Skip to main content

Thin client for the RQFC fund trading backend

Project description

rqfc

Thin Python client for the RQFC fund trading backend.

Traders log in with credentials or an API key issued by an admin. The backend owns authentication, permissions, and each pod's Alpaca credentials, then submits trades on the trader's behalf. No Alpaca keys or Supabase settings ever touch this client. A pod is one Alpaca account; several traders share a pod; admins can trade any pod and manage capital/membership.

See ../docs/ARCHITECTURE.md and ../docs/RUNBOOK.md for the full system.

Install

From GitHub:

pip install git+https://github.com/Rutgers-Quant-Finance-Club/fund.git

After publishing to PyPI, this becomes:

pip install rqfc

For local package development from this repo:

pip install -e .

Trader Login

By default, rqfc talks to the deployed RQFC API:

https://fund-tkb1.onrender.com

Admins issue either email/password credentials or a trader API key. Traders do not need to configure Supabase or Alpaca.

Email/password login:

import rqfc

rqfc.login("alice@example.com", "password")

API key login, useful for scripts and strategy runners:

import rqfc

rqfc.login(api_key="rqfc_...")

Local Dev Override

To test against a local or staging backend, use RQFC_BACKEND_URL:

export RQFC_BACKEND_URL=http://localhost:8000

Or pass it directly:

import rqfc

rqfc.login("alice@example.com", "password", backend_url="http://localhost:8000")

Trader Usage

import rqfc

rqfc.login(api_key="rqfc_...")

rqfc.whoami()                 # your profile + assigned pods

acct = rqfc.pod("Alpha Equities")   # by name or id; must be assigned
acct.buy("AAPL", 10)
acct.sell("AAPL", 5)
acct.short("TSLA", 3)
acct.dollar_buy("NVDA", 5000)
acct.account()                # live equity / cash / buying power
acct.positions()              # live positions
acct.price("AAPL")
acct.sync()                   # refresh the dashboard (positions, NAV, metrics)

Admin Usage

rqfc.login("admin@example.com", "password")
admin = rqfc.admin()

pod = admin.create_pod("Vol Arb", "options", capital=100000,
                       alpaca_api_key="PK...", alpaca_api_secret="...")
admin.list_traders()
admin.add_trader(pod["id"], trader_id, role="trader")
admin.allocate_capital(pod["id"], 150000)
admin.remove_trader(pod["id"], trader_id)

Method Reference

Account (rqfc.pod(...)): buy, sell, short, cover, dollar_buy, dollar_sell, cancel, account, positions, price, bars, sync.

Admin (rqfc.admin()): create_pod, set_alpaca, allocate_capital, list_traders, add_trader, remove_trader.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rqfc_dev-1.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rqfc_dev-1.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file rqfc_dev-1.1.0.tar.gz.

File metadata

  • Download URL: rqfc_dev-1.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for rqfc_dev-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e5e87639a7b8d2d82b104d1c443a6edd0cfb99d2bbcaddb96bb8f0993d9a67ab
MD5 41cc62b7723ec63fef5bacfe67be61f2
BLAKE2b-256 f54b35c14d8451a8a833c198649d2808b04994dca3a9d097f237b29749d57c12

See more details on using hashes here.

File details

Details for the file rqfc_dev-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: rqfc_dev-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for rqfc_dev-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1cebd4784263050bc0694d4cb3bacbfa2bdd01ae17a6c4704d19a92ce6e36185
MD5 f5db96ca4b736fa5e80f964805b94778
BLAKE2b-256 9ec05adafe8e8ef03ff30c2c817f92694bcaa39f6ade0e90e65a5cbaf3f44b14

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page