Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"standardwebhooks": ">=1.0.1,<2"
}
},
"originGitCommit": "717d8221c5238883c99d81db2f1e391fded6b21f",
"originGitCommit": "afd35eaf41c7a23f1ba14e6e439360231ed9c9ef",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "2.2.0",
Expand Down
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

134 changes: 21 additions & 113 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -41716,7 +41716,7 @@ client.topups.create(
<dl>
<dd>

Lists trades you can access, newest first. User credentials see their own trades and those of accounts they belong to, including connected accounts; account credentials see their account and its connected accounts. These are submission records, not fill or position history.
Lists trades you can access, newest first. User credentials see their own trades and those of accounts they belong to, including connected accounts; account credentials see their account and its connected accounts.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -41763,15 +41763,15 @@ client.trades.list()
<dl>
<dd>

**status:** `typing.Optional[ListTradesRequestStatus]` — Only return trades with this submission status.
**status:** `typing.Optional[ListTradesRequestStatus]` — Only return trades with this status.

</dd>
</dl>

<dl>
<dd>

**operation_type:** `typing.Optional[ListTradesRequestOperationType]` — Only return trades of this kind, such as `create_orders` for order submissions.
**type:** `typing.Optional[ListTradesRequestType]` — Only return trades of this type.

</dd>
</dl>
Expand Down Expand Up @@ -41839,7 +41839,7 @@ client.trades.list()
</dl>
</details>

<details><summary><code>client.trades.<a href="src/whop_sdk/trades/client.py">create</a>()</code></summary>
<details><summary><code>client.trades.<a href="src/whop_sdk/trades/client.py">create</a>(...) -> Trade</code></summary>
<dl>
<dd>

Expand All @@ -41851,7 +41851,7 @@ client.trades.list()
<dl>
<dd>

Retired. Order batches can no longer be placed. Every caller gets `410 Gone`, whatever the body, and nothing is sent to the trading provider. List and retrieve earlier trades with `GET /trades`.
Creates a trade on the Whop-managed wallet of an account or user and answers `201` with the trade in `pending`. The trade runs in the background; read it with `GET /trades/{id}` until it is `completed`, `failed` or `in_review`. A `buy` bridges `amount` USDT0 to the trading account, sets `leverage` (cross) on `market`, and places one market buy. If the buy does not fill, its money goes back to the wallet. A `close` closes the position in `market`, if one is open, and sends all withdrawable USDC back to the wallet. One trade runs at a time for each wallet. A retry with the same `Idempotency-Key` returns the same trade.
</dd>
</dl>
</dd>
Expand All @@ -41874,7 +41874,11 @@ client = Whop(
environment=WhopEnvironment.PRODUCTION,
)

client.trades.create()
client.trades.create(
account_id="biz_xxxxxxxxxxxxxx",
market="BTC",
type="buy",
)

```
</dd>
Expand All @@ -41890,135 +41894,39 @@ client.trades.create()
<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
**account_id:** `str` — The account or user whose wallet trades, prefixed `biz_` or `user_`.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.trades.<a href="src/whop_sdk/trades/client.py">update_leverage</a>()</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Retired. Every caller gets `410 Gone`, and no leverage change is sent to the trading provider.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from whop_sdk import Whop
from whop_sdk.environment import WhopEnvironment

client = Whop(
token="<token>",
environment=WhopEnvironment.PRODUCTION,
)

client.trades.update_leverage()

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
**market:** `str` — The perpetual market, for example `BTC`.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.trades.<a href="src/whop_sdk/trades/client.py">retrieve</a>(...) -> Trade</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Retrieves a trade. Order acknowledgements don't update as orders fill. Never resubmit a `submission_unknown` trade with a new idempotency key.
</dd>
</dl>
**type:** `CreateTradesRequestType` — `buy` or `close`.

</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from whop_sdk import Whop
from whop_sdk.environment import WhopEnvironment

client = Whop(
token="<token>",
environment=WhopEnvironment.PRODUCTION,
)

client.trades.retrieve(
id="id",
)

```
</dd>
</dl>
**amount:** `typing.Optional[str]` — The USDT0 to send from the wallet for a buy, with at most 6 decimals. Required for a buy.

</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**id:** `str` — Trade ID, prefixed `trop_`.
**leverage:** `typing.Optional[int]` — The cross leverage for a buy, from 1 to the market's maximum. Required for a buy.

</dd>
</dl>
Expand All @@ -42038,7 +41946,7 @@ client.trades.retrieve(
</dl>
</details>

<details><summary><code>client.trades.<a href="src/whop_sdk/trades/client.py">cancel</a>(...)</code></summary>
<details><summary><code>client.trades.<a href="src/whop_sdk/trades/client.py">retrieve</a>(...) -> Trade</code></summary>
<dl>
<dd>

Expand All @@ -42050,7 +41958,7 @@ client.trades.retrieve(
<dl>
<dd>

Retired. Every caller gets `410 Gone`, and no cancellation is sent to the trading provider.
Retrieves a trade. Read it until its `status` is `completed`, `failed` or `in_review`.
</dd>
</dl>
</dd>
Expand All @@ -42073,7 +41981,7 @@ client = Whop(
environment=WhopEnvironment.PRODUCTION,
)

client.trades.cancel(
client.trades.retrieve(
id="id",
)

Expand All @@ -42091,7 +41999,7 @@ client.trades.cancel(
<dl>
<dd>

**id:** `str` — ID of the order trade to cancel, prefixed `trop_`.
**id:** `str` — Trade ID, prefixed `tint_`.

</dd>
</dl>
Expand Down
Loading
Loading