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.0.0.tar.gz (6.4 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.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rqfc_dev-1.0.0.tar.gz
  • Upload date:
  • Size: 6.4 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.0.0.tar.gz
Algorithm Hash digest
SHA256 703d025adb81876412a6925073e3fb7c01566d4cbd03a5336e832071afe91e61
MD5 1262c303f76831ff5661491beda2f9a7
BLAKE2b-256 4d8e530b9c7f934ace1af7c5ab6f8c3b3577cfdf15c5ab0825d30d82eae09dfd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rqfc_dev-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a28bbb1631ac2b37f12182629b8e07f97ddb426f1916cc18737e98b9dede0669
MD5 7bab93379207ce0fd94fdf1345e7a7cb
BLAKE2b-256 3eaf8f9538a4fb638c7ca64f9dc63fb622a68bc44bf8edd43281a38bbd8a82d1

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