Skip to content

Commit fce449a

Browse files
committed
Merge branch 'maker-rebate-activity'
2 parents 9f00f39 + d7701fd commit fce449a

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ flowchart LR
124124
- #### Trades
125125
- get trades with pagination, filter by `condition id`, user address, side, taker only or not, cash amount/token amount
126126
- #### Activity
127-
- get activity with pagination by user address, filter by type (trade, split, merge, redeem, reward, conversion), `condition_id`, time window, side, sort by timestamp/tokens/cash
127+
- get activity with pagination by user address, filter by type (trade, split, merge, redeem, reward, conversion, maker_rebate, yield), `condition_id`, time window, side, sort by timestamp/tokens/cash
128128
- #### Holders
129129
- get top holders by `condition_id`
130130
- #### Value

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "polymarket-apis"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
description = "Unified Polymarket APIs with Pydantic data validation - Clob, Gamma, Data, Web3, Websockets, GraphQL clients."
55
readme = "README.md"
66
requires-python = ">=3.12"

src/polymarket_apis/clients/data_client.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from ..types.data_types import (
1313
AccountingSnapshotCSVs,
1414
Activity,
15+
ActivityType,
1516
BuilderLeaderboardUser,
1617
ClosedPosition,
1718
EventLiveVolume,
@@ -184,14 +185,7 @@ def get_activity(
184185
offset: int = 0,
185186
condition_id: Optional[Union[str, list[str]]] = None,
186187
event_id: Optional[Union[int, list[int]]] = None,
187-
type: Optional[
188-
Union[
189-
Literal["TRADE", "SPLIT", "MERGE", "REDEEM", "REWARD", "CONVERSION"],
190-
list[
191-
Literal["TRADE", "SPLIT", "MERGE", "REDEEM", "REWARD", "CONVERSION"]
192-
],
193-
]
194-
] = None,
188+
type: Optional[Union[ActivityType, list[ActivityType]]] = None,
195189
start: Optional[datetime] = None,
196190
end: Optional[datetime] = None,
197191
side: Optional[Literal["BUY", "SELL"]] = None,

src/polymarket_apis/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
)
4949
from .data_types import (
5050
Activity,
51+
ActivityType,
5152
Holder,
5253
HolderResponse,
5354
Position,
@@ -93,6 +94,7 @@
9394
"Activity",
9495
"ActivityOrderMatchEvent",
9596
"ActivityTradeEvent",
97+
"ActivityType",
9698
"ApiCreds",
9799
"AssetPriceSubscribeEvent",
98100
"AssetPriceUpdateEvent",

src/polymarket_apis/types/data_types.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
from .common import EmptyString, EthAddress, Keccak256
77

8+
# Type aliases
9+
type ActivityType = Literal[
10+
"TRADE", "SPLIT", "MERGE", "REDEEM", "REWARD", "CONVERSION", "MAKER_REBATE", "YIELD"
11+
]
12+
813

914
class AccountingSnapshotCSVs(BaseModel):
1015
"""Parsed contents of the accounting snapshot ZIP."""
@@ -163,7 +168,7 @@ class Activity(BaseModel):
163168
# Activity details
164169
timestamp: datetime
165170
condition_id: Keccak256 | EmptyString = Field(alias="conditionId")
166-
type: Literal["TRADE", "SPLIT", "MERGE", "REDEEM", "REWARD", "CONVERSION"]
171+
type: ActivityType
167172
size: float
168173
usdc_size: float = Field(alias="usdcSize")
169174
price: float

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)