sbenthall / SHARKFin

Simulating Heterogeneous Agents with Finance
6 stars 5 forks source link

Use execution price in SHARKFin #198

Open sbenthall opened 1 year ago

sbenthall commented 1 year ago

Currently SHARKFin interacts with the Broker/Market only through the previous day's closing price.

But it would be better if we could get the average Broker execution price coming back at the end of the day.

This raises some questions about how the SHARKFin agents use either the execution or closing prices.

Simplest would be to just use the execution price as the price for SHARKFin. I.e. realize consumer returns on the risky asset according the the execution price, and compute expectations accordingly. However, the execution price is currently undefined when there are zero orders sent to the broker, and there will be both bid and ask prices, and these will be different.

Then there is the issue that consumers won't always be trading all of their risky assets. Do their non-traded holdings change 'value' based on the execution price?

If there are multiple prices emitted by the RPCMarket, then it can be a parameter setting which to use as the 'price' for the purpose of computing SHARKFin values.

sbenthall commented 1 year ago

image

sbenthall commented 1 year ago

167db introduces a new command line argument, --macro_price_field, which defaults to ClosingPrice.

It gets used to select which field of the AMMPS RPC response gets used as the 'price' for the purposes of computing returns.

@mesalas if you expose execution price(s) in the RPC response object, this parameter will allow us to configure which one of these SHARKFin uses.

mesalas commented 1 year ago

Implementing tracking of broker execution price https://github.com/ZDavid/amm.engine/issues/18