sbenthall / SHARKFin

Simulating Heterogeneous Agents with Finance
6 stars 5 forks source link

Parameter sweep over Broker's ability to clear buy/sell orders internally #187

Closed sbenthall closed 1 year ago

sbenthall commented 1 year ago

Currently the brokers do not clear buy/sell orders before floating them on the market.

But to address the SEC's concerns, we can sweep over this parameter and see if it effects outcomes.

sbenthall commented 1 year ago

Pass this through with the broker orders at each time step. Enter through CLI.

So there's the possibility of shocking later.

sbenthall commented 1 year ago

Commit 84f9e6f adds a CLI argument mba (market broker argument) which is then passed through to the Broker class and passed along to the Market in run_market. In the AMMPS market class, this argument is added to the data dictionary passed through the RPC to AMMPS.

The field in data is literally going to be market_broker_arg. Down the line, I'd like this to be more general functionality, so it's possible to pass a dictionary of arguments in to the broker, expectations, and market classes. That's a little tricky to do with the CLI but it's more in the spirit of the model architecture.

I haven't yet tested this with a local AMMPS, so I'm not closing the ticket just yet.

sbenthall commented 1 year ago

I've now tested this locally with AMMPS. Nothing breaks. But also, this field has no functionality yet.

Assigning this ticket to @mesalas now for connecting this to the AMMPS broker's internalization behavior.

mesalas commented 1 year ago

broker is now looking for a market_broker_arg field in the data received from sharkfin. This will determine fraction of the volume it will send to the public market. If no field is pressent it will default to 0.66.

Tested with latest sharkfin an can confirm the data is being received image