Skip to content

Commit 24108e2

Browse files
committed
Connect wiki.openpit.dev
1 parent 952bb29 commit 24108e2

15 files changed

Lines changed: 176 additions & 82 deletions

File tree

.github/workflows/wiki.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Copyright The Pit Project Owners. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Please see https://openpit.dev and the OWNERS file for details.
17+
18+
name: Wiki
19+
20+
on:
21+
gollum:
22+
workflow_dispatch:
23+
push:
24+
branches:
25+
- main
26+
paths:
27+
- .github/workflows/wiki.yml
28+
29+
permissions:
30+
contents: read
31+
deployments: write
32+
33+
concurrency:
34+
group: wiki-${{ github.ref }}
35+
cancel-in-progress: true
36+
37+
jobs:
38+
build-deploy:
39+
name: Build and deploy wiki
40+
runs-on: ubuntu-22.04
41+
steps:
42+
- name: Checkout workflow repository
43+
uses: actions/checkout@v4
44+
45+
- name: Clone wiki repository
46+
run: |
47+
git clone \
48+
--depth 1 \
49+
"https://github.com/${{ github.repository }}.wiki.git" \
50+
"$RUNNER_TEMP/pit.wiki"
51+
52+
- name: Setup Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: "3.12"
56+
cache: pip
57+
cache-dependency-path: ${{ runner.temp }}/pit.wiki/.site/requirements.txt
58+
59+
- name: Install wiki build dependencies
60+
working-directory: ${{ runner.temp }}/pit.wiki
61+
run: python -m pip install -r .site/requirements.txt
62+
63+
- name: Prepare wiki source
64+
working-directory: ${{ runner.temp }}/pit.wiki
65+
run: python .site/scripts/prepare_wiki_source.py --source .
66+
67+
- name: Build wiki
68+
working-directory: ${{ runner.temp }}/pit.wiki
69+
run: mkdocs build --strict --config-file .site/mkdocs.yml
70+
71+
- name: Check Cloudflare configuration
72+
env:
73+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
74+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
75+
run: |
76+
missing=0
77+
if [ -z "$CLOUDFLARE_ACCOUNT_ID" ]; then
78+
echo "::error::CLOUDFLARE_ACCOUNT_ID secret is not configured"
79+
missing=1
80+
fi
81+
if [ -z "$CLOUDFLARE_API_TOKEN" ]; then
82+
echo "::error::CLOUDFLARE_API_TOKEN secret is not configured"
83+
missing=1
84+
fi
85+
exit "$missing"
86+
87+
- name: Deploy wiki to Cloudflare Pages
88+
uses: cloudflare/wrangler-action@v3
89+
with:
90+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
91+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
92+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
93+
command: >-
94+
pages deploy ${{ runner.temp }}/pit.wiki/.site/site
95+
--project-name=openpit-wiki

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,35 +41,35 @@ The current implementation focuses on the pre-trade pipeline, a small set
4141
of built-in controls, and an API for building project-specific strategy and
4242
risk policies. Built-ins:
4343

44-
- [Spot Funds](https://github.com/openpitkit/pit/wiki/Spot-Funds) - per-account
44+
- [Spot Funds](https://wiki.openpit.dev/Spot-Funds/) - per-account
4545
solvency gate over spendable funds.
46-
- [Order Validation](https://github.com/openpitkit/pit/wiki/Policies#ordervalidationpolicy)
46+
- [Order Validation](https://wiki.openpit.dev/Policies/#ordervalidationpolicy)
4747
\- structural integrity checks on every order.
48-
- [Rate Limit](https://github.com/openpitkit/pit/wiki/Policies#ratelimitpolicy)
48+
- [Rate Limit](https://wiki.openpit.dev/Policies/#ratelimitpolicy)
4949
\- throttle order flow per broker, asset, or account.
50-
- [Order Size Limit](https://github.com/openpitkit/pit/wiki/Policies#ordersizelimitpolicy)
50+
- [Order Size Limit](https://wiki.openpit.dev/Policies/#ordersizelimitpolicy)
5151
\- fat-finger caps on quantity and notional.
52-
- [P&L Kill Switch](https://github.com/openpitkit/pit/wiki/Policies#pnlboundskillswitchpolicy)
52+
- [P&L Kill Switch](https://wiki.openpit.dev/Policies/#pnlboundskillswitchpolicy)
5353
\- halt an account when realized P&L breaches bounds.
54-
- plus your own via the [policy SDK](https://github.com/openpitkit/pit/wiki/Policy-API).
54+
- plus your own via the [policy SDK](https://wiki.openpit.dev/Policy-API/).
5555

5656
Custom policies that maintain state across calls can use the built-in
57-
[Storage](https://github.com/openpitkit/pit/wiki/Storage) abstraction.
57+
[Storage](https://wiki.openpit.dev/Storage/) abstraction.
5858
Synchronization is selected once at engine construction and applied
5959
transparently, with no overhead in single-threaded embeddings.
6060

6161
Controls can act both by account and by group of accounts: register accounts
62-
under a compact identifier with [Account Groups](https://github.com/openpitkit/pit/wiki/Account-Groups)
62+
under a compact identifier with [Account Groups](https://wiki.openpit.dev/Account-Groups/)
6363
and let a policy branch on the group instead of an enumerated account list.
6464

6565
The engine is intentionally in-memory and deterministic, designed to be
6666
embedded into a larger trading system rather than replace one. For custom
6767
policy APIs:
6868

69-
- [Go custom policies](https://github.com/openpitkit/pit/wiki/Policy-API#go-interface)
70-
- [Python custom policies](https://github.com/openpitkit/pit/wiki/Policy-API#python-interface)
71-
- [C++ custom policies](https://github.com/openpitkit/pit/wiki/Policy-API#c-interface)
72-
- [Rust custom policies](https://github.com/openpitkit/pit/wiki/Policy-API#rust-interface)
69+
- [Go custom policies](https://wiki.openpit.dev/Policy-API/#go-interface)
70+
- [Python custom policies](https://wiki.openpit.dev/Policy-API/#python-interface)
71+
- [C++ custom policies](https://wiki.openpit.dev/Policy-API/#c-interface)
72+
- [Rust custom policies](https://wiki.openpit.dev/Policy-API/#rust-interface)
7373

7474
## Versioning Policy (Pre‑1.0)
7575

@@ -95,7 +95,7 @@ constraints that tolerate API evolution during the pre-stable phase.
9595
- [C SDK README](bindings/c/README.md) - C interface for environments that
9696
integrate through C.
9797
- [examples/](examples/) - end-to-end runnable scenarios.
98-
- [Wiki](https://github.com/openpitkit/pit/wiki) - conceptual pages and
98+
- [Wiki](https://wiki.openpit.dev/) - conceptual pages and
9999
architecture notes.
100100

101101
## Local Build And Test

bindings/c/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ that consume a C ABI.
1010

1111
For an overview and links to all resources, see the project website [openpit.dev](https://openpit.dev/).
1212
For full project documentation, see [the repository README](https://github.com/openpitkit/pit/blob/main/README.md).
13-
For conceptual and architectural pages, see [the project wiki](https://github.com/openpitkit/pit/wiki).
13+
For conceptual and architectural pages, see [the project wiki](https://wiki.openpit.dev/).
1414
For the split C reference manual, see [the C API docs](https://github.com/openpitkit/pit/blob/main/docs/c-api/index.md).
1515

1616
## Versioning Policy (Pre‑1.0)
@@ -133,17 +133,17 @@ reject is produced.
133133

134134
Built-in policies:
135135

136-
- [Spot Funds](https://github.com/openpitkit/pit/wiki/Spot-Funds) - per-account
136+
- [Spot Funds](https://wiki.openpit.dev/Spot-Funds/) - per-account
137137
solvency gate over spendable funds.
138-
- [Order Validation](https://github.com/openpitkit/pit/wiki/Policies#ordervalidationpolicy)
138+
- [Order Validation](https://wiki.openpit.dev/Policies/#ordervalidationpolicy)
139139
\- structural integrity checks on every order.
140-
- [Rate Limit](https://github.com/openpitkit/pit/wiki/Policies#ratelimitpolicy)
140+
- [Rate Limit](https://wiki.openpit.dev/Policies/#ratelimitpolicy)
141141
\- throttle order flow per broker, asset, or account.
142-
- [Order Size Limit](https://github.com/openpitkit/pit/wiki/Policies#ordersizelimitpolicy)
142+
- [Order Size Limit](https://wiki.openpit.dev/Policies/#ordersizelimitpolicy)
143143
\- fat-finger caps on quantity and notional.
144-
- [P&L Kill Switch](https://github.com/openpitkit/pit/wiki/Policies#pnlboundskillswitchpolicy)
144+
- [P&L Kill Switch](https://wiki.openpit.dev/Policies/#pnlboundskillswitchpolicy)
145145
\- halt an account when realized P&L breaches bounds.
146-
- plus your own via the [policy SDK](https://github.com/openpitkit/pit/wiki/Policy-API).
146+
- plus your own via the [policy SDK](https://wiki.openpit.dev/Policy-API/).
147147

148148
The primary integration model is to build project-specific policies against the
149149
public C API: [the C API docs](../../docs/c-api/index.md).
@@ -153,7 +153,7 @@ rejection of only the current request. Kill switches are intended for
153153
algorithmic trading where automatic order submission must be halted until the
154154
situation is analyzed.
155155

156-
Built-in policies that maintain state across calls use the SDK's [Storage](https://github.com/openpitkit/pit/wiki/Storage)
156+
Built-in policies that maintain state across calls use the SDK's [Storage](https://wiki.openpit.dev/Storage/)
157157
abstraction internally. The runtime library handles the necessary memory
158158
synchronization for policy state; the C consumer is responsible only for the
159159
threading contract on the SDK handle.

bindings/cpp/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ is packaged as a CMake config package and exposes the `OpenPit::openpit` target.
1313
For an overview and links to all resources, see the project website [openpit.dev](https://openpit.dev/).
1414
For the C++ API reference, see [the C++ API docs](../../docs/cpp-api/index.html).
1515
For full project documentation, see [the repository README](https://github.com/openpitkit/pit/blob/main/README.md).
16-
For conceptual and architectural pages, see [the project wiki](https://github.com/openpitkit/pit/wiki).
16+
For conceptual and architectural pages, see [the project wiki](https://wiki.openpit.dev/).
1717

1818
## Versioning Policy (Pre-1.0)
1919

@@ -142,15 +142,15 @@ in reverse order when any reject is produced.
142142
Built-in policies:
143143

144144
- `SpotFundsPolicy` -
145-
[per-account solvency gate over spendable funds](https://github.com/openpitkit/pit/wiki/Spot-Funds)
146-
- `OrderValidationPolicy` - [structural integrity checks on every order](https://github.com/openpitkit/pit/wiki/Policies#ordervalidationpolicy)
147-
- `RateLimitPolicy` - [throttle order flow per broker, asset, or account](https://github.com/openpitkit/pit/wiki/Policies#ratelimitpolicy)
148-
- `OrderSizeLimitPolicy` - [fat-finger caps on quantity and notional](https://github.com/openpitkit/pit/wiki/Policies#ordersizelimitpolicy)
149-
- `PnlBoundsKillSwitchPolicy` - [halt an account when realized P&L breaches bounds](https://github.com/openpitkit/pit/wiki/Policies#pnlboundskillswitchpolicy)
145+
[per-account solvency gate over spendable funds](https://wiki.openpit.dev/Spot-Funds/)
146+
- `OrderValidationPolicy` - [structural integrity checks on every order](https://wiki.openpit.dev/Policies/#ordervalidationpolicy)
147+
- `RateLimitPolicy` - [throttle order flow per broker, asset, or account](https://wiki.openpit.dev/Policies/#ratelimitpolicy)
148+
- `OrderSizeLimitPolicy` - [fat-finger caps on quantity and notional](https://wiki.openpit.dev/Policies/#ordersizelimitpolicy)
149+
- `PnlBoundsKillSwitchPolicy` - [halt an account when realized P&L breaches bounds](https://wiki.openpit.dev/Policies/#pnlboundskillswitchpolicy)
150150

151151
The primary integration model is to write project-specific policies against
152152
the public C++ policy API:
153-
[Custom C++ policies](https://github.com/openpitkit/pit/wiki/Policy-API#c-interface).
153+
[Custom C++ policies](https://wiki.openpit.dev/Policy-API/#c-interface).
154154

155155
## Usage
156156

@@ -205,7 +205,7 @@ wrapper owns the default C++ engine adapter and exposes the typed async methods
205205

206206
## Threading
207207

208-
Canonical contract: [Threading Contract](https://github.com/openpitkit/pit/wiki/Threading-Contract).
208+
Canonical contract: [Threading Contract](https://wiki.openpit.dev/Threading-Contract/).
209209

210210
Choose the storage synchronization policy when building the engine:
211211

@@ -214,7 +214,7 @@ Choose the storage synchronization policy when building the engine:
214214
- `openpit::SyncPolicy::Account` - account-sharded synchronization.
215215

216216
Custom policies that need internal state across calls use the built-in
217-
[Storage](https://github.com/openpitkit/pit/wiki/Storage) abstraction:
217+
[Storage](https://wiki.openpit.dev/Storage/) abstraction:
218218
synchronization-aware key-value storage that keeps locking details out of
219219
policy code.
220220

bindings/go/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ risk checks into trading systems from Go.
1313

1414
For an overview and links to all resources, see the project website [openpit.dev](https://openpit.dev/).
1515
For full project documentation, see [the repository README](https://github.com/openpitkit/pit/blob/main/README.md).
16-
For conceptual and architectural pages, see [the project wiki](https://github.com/openpitkit/pit/wiki).
16+
For conceptual and architectural pages, see [the project wiki](https://wiki.openpit.dev/).
1717
For the public Go module source, see [go.openpit.dev/openpit](https://go.openpit.dev/openpit).
1818

1919
## Versioning Policy (Pre‑1.0)
@@ -31,7 +31,7 @@ phase.
3131
## Getting Started
3232

3333
Visit the [Go module page](https://go.openpit.dev/openpit) and the
34-
[project wiki](https://github.com/openpitkit/pit/wiki) for conceptual pages
34+
[project wiki](https://wiki.openpit.dev/) for conceptual pages
3535
and architecture notes.
3636

3737
## Examples
@@ -134,21 +134,21 @@ in reverse order when any reject is produced.
134134

135135
Built-in policies:
136136

137-
- [Spot Funds](https://github.com/openpitkit/pit/wiki/Spot-Funds) - per-account
137+
- [Spot Funds](https://wiki.openpit.dev/Spot-Funds/) - per-account
138138
solvency gate over spendable funds.
139-
- [Order Validation](https://github.com/openpitkit/pit/wiki/Policies#ordervalidationpolicy)
139+
- [Order Validation](https://wiki.openpit.dev/Policies/#ordervalidationpolicy)
140140
\- structural integrity checks on every order.
141-
- [Rate Limit](https://github.com/openpitkit/pit/wiki/Policies#ratelimitpolicy)
141+
- [Rate Limit](https://wiki.openpit.dev/Policies/#ratelimitpolicy)
142142
\- throttle order flow per broker, asset, or account.
143-
- [Order Size Limit](https://github.com/openpitkit/pit/wiki/Policies#ordersizelimitpolicy)
143+
- [Order Size Limit](https://wiki.openpit.dev/Policies/#ordersizelimitpolicy)
144144
\- fat-finger caps on quantity and notional.
145-
- [P&L Kill Switch](https://github.com/openpitkit/pit/wiki/Policies#pnlboundskillswitchpolicy)
145+
- [P&L Kill Switch](https://wiki.openpit.dev/Policies/#pnlboundskillswitchpolicy)
146146
\- halt an account when realized P&L breaches bounds.
147-
- plus your own via the [policy SDK](https://github.com/openpitkit/pit/wiki/Policy-API#go-interface).
147+
- plus your own via the [policy SDK](https://wiki.openpit.dev/Policy-API/#go-interface).
148148

149149
The primary integration model is to write project-specific policies against
150150
the public Go policy API:
151-
[Custom Go policies](https://github.com/openpitkit/pit/wiki/Policy-API#go-interface).
151+
[Custom Go policies](https://wiki.openpit.dev/Policy-API/#go-interface).
152152

153153
Two types of rejections are supported: a full kill switch for the account
154154
and a rejection of only the current request. Kill switches are intended
@@ -157,14 +157,14 @@ until the situation is analyzed.
157157

158158
## Threading
159159

160-
Canonical contract: [Threading Contract](https://github.com/openpitkit/pit/wiki/Threading-Contract).
160+
Canonical contract: [Threading Contract](https://wiki.openpit.dev/Threading-Contract/).
161161

162162
Goroutine migration between OS threads during one SDK call is supported,
163163
and callbacks invoked by the SDK may run on a different OS thread than the
164164
goroutine that initiated the call.
165165

166166
Custom policies that need internal state across calls use the built-in
167-
[Storage](https://github.com/openpitkit/pit/wiki/Storage) abstraction:
167+
[Storage](https://wiki.openpit.dev/Storage/) abstraction:
168168
synchronization-aware key-value storage that handles goroutine migration
169169
correctly without exposing locks to policy code.
170170

bindings/python/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ risk checks into trading systems from Python.
1010
For an overview and links to all resources, see the project website [openpit.dev](https://openpit.dev/).
1111
For the Python API guide and reference, see [openpit.readthedocs.io](https://openpit.readthedocs.io/en/stable/).
1212
For full project documentation, see [the repository README](https://github.com/openpitkit/pit/blob/main/README.md).
13-
For conceptual and architectural pages, see [the project wiki](https://github.com/openpitkit/pit/wiki).
13+
For conceptual and architectural pages, see [the project wiki](https://wiki.openpit.dev/).
1414

1515
## Versioning Policy (Pre‑1.0)
1616

@@ -133,26 +133,26 @@ order when any reject is produced.
133133
Built-in policies:
134134

135135
- `SpotFundsPolicy` -
136-
[per-account solvency gate over spendable funds](https://github.com/openpitkit/pit/wiki/Spot-Funds)
137-
- `OrderValidationPolicy` - [structural integrity checks on every order](https://github.com/openpitkit/pit/wiki/Policies#ordervalidationpolicy)
138-
- `RateLimitPolicy` - [throttle order flow per broker, asset, or account](https://github.com/openpitkit/pit/wiki/Policies#ratelimitpolicy)
139-
- `OrderSizeLimitPolicy` - [fat-finger caps on quantity and notional](https://github.com/openpitkit/pit/wiki/Policies#ordersizelimitpolicy)
140-
- `PnlBoundsKillSwitchPolicy` - [halt an account when realized P&L breaches bounds](https://github.com/openpitkit/pit/wiki/Policies#pnlboundskillswitchpolicy)
136+
[per-account solvency gate over spendable funds](https://wiki.openpit.dev/Spot-Funds/)
137+
- `OrderValidationPolicy` - [structural integrity checks on every order](https://wiki.openpit.dev/Policies/#ordervalidationpolicy)
138+
- `RateLimitPolicy` - [throttle order flow per broker, asset, or account](https://wiki.openpit.dev/Policies/#ratelimitpolicy)
139+
- `OrderSizeLimitPolicy` - [fat-finger caps on quantity and notional](https://wiki.openpit.dev/Policies/#ordersizelimitpolicy)
140+
- `PnlBoundsKillSwitchPolicy` - [halt an account when realized P&L breaches bounds](https://wiki.openpit.dev/Policies/#pnlboundskillswitchpolicy)
141141

142142
The primary integration model is to write project-specific policies against
143143
the public Python policy API:
144-
[Custom Python policies](https://github.com/openpitkit/pit/wiki/Policy-API#python-interface).
144+
[Custom Python policies](https://wiki.openpit.dev/Policy-API/#python-interface).
145145

146146
## Threading
147147

148-
Canonical contract: [Threading Contract](https://github.com/openpitkit/pit/wiki/Threading-Contract).
148+
Canonical contract: [Threading Contract](https://wiki.openpit.dev/Threading-Contract/).
149149

150150
Public methods acquire the GIL when needed; the SDK does not release the
151151
GIL across callback boundaries, so Python policies execute on the calling
152152
thread.
153153

154154
Custom policies that need internal state across calls can use the built-in
155-
[Storage](https://github.com/openpitkit/pit/wiki/Storage) abstraction. In
155+
[Storage](https://wiki.openpit.dev/Storage/) abstraction. In
156156
typical Python usage (synchronous code or an asyncio loop pinned to one
157157
thread) the no-sync policy is sufficient and the storage compiles down to
158158
direct dictionary access. A synchronizing policy is needed only when the

0 commit comments

Comments
 (0)