CPX Module
- class CPX(*args: Any, **kwargs: Any)
Bases:
CogChiipoints Exchange (CPX)
- cpx = <discord.app_commands.commands.Group object>
- async market(interaction: Interaction)
…
Syntax:
/cpx market
- async buy(interaction: Interaction, symbol: str, shares: int)
…
Syntax:
/cpx buy
- async sell(interaction: Interaction, symbol: str, shares: int)
…
Syntax:
/cpx sell
- async news(interaction: Interaction)
…
Syntax:
/cpx news
- async portfolio(interaction: Interaction, member: Member | None = None)
…
Syntax:
/cpx portfolio
- async stonks(interaction: Interaction, asset_1: str, asset_2: str | None = None, asset_3: str | None = None, days: int | None = None)
…
Syntax:
/cpx stonks
- async setprice(ctx: Context, symbol: str, price: int)
Manually set the current price of a CPX asset
Aliases:
cpxsetprice
- async addasset(ctx: Context, symbol: str, name: str, asset_type: str, base_price: int, *, match_string: str)
Add a new asset to the CPX market
Aliases:
cpxaddasset
- async map_child_parent(ctx: Context, child: str, parent: str, weight: float)
Map a child asset to a parent asset with spillover weight
Aliases:
cpxmap
- async unmap_child_parent(ctx: Context, child: str, parent: str)
Remove a mapping between child and parent assets
Aliases:
cpxunmap
- async deactivate_asset(ctx: Context, symbol: str)
Deactivate a CPX asset (removes from active trading)
Aliases:
cpxdeactivate
- async graph(ctx: Context)
Display the asset mapping hierarchy tree
Aliases:
cpxgraph
- async importassets(ctx: Context)
Import assets and mappings from CSV files (attach 2 files: assets CSV and mappings CSV)
Aliases:
cpximport
- async exportassets(ctx: Context)
Export all assets and mappings to CSV files
Aliases:
cpxexport
- async exportstate(ctx: Context)
Export full CPX state snapshot (assets, portfolios, news) to CSV files
Aliases:
cpxexportstate
- async update_market(ctx: Context)
Manually trigger a market price update for all assets
Aliases:
cpxupdate
- async remap_asset(ctx: Context, child: str, old_parent: str, new_parent: str, weight: float | None = None)
Move an asset mapping from one parent to another (preserves weight)
Aliases:
cpxremap