Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actor creation problem in 1.1.5 #93

Open
nalinbhatt opened this issue Aug 16, 2022 · 0 comments
Open

Actor creation problem in 1.1.5 #93

nalinbhatt opened this issue Aug 16, 2022 · 0 comments
Labels
1.1.5 mTree version

Comments

@nalinbhatt
Copy link
Collaborator

Problem

Currently if you have institutions listed in the following format it only instantiates a single instance of one of the following.

{"institutions": {"institution_name": "institution_filename.InstitutionClass", "number": 1 }, 
                          {"institution_name": "institution_filename.InstitutionClass", "number": 1}}

it creates a single institution with the short_name institution_filename.InstitutionClass 1 instead of two institutions with short_name - institution_filename.InstitutionClass 1, institution_filename.InstitutionClass 2

if you look at system.log line 163 you can see in the address_book that there is only 1 instance of account.Account 1 but multiple institutions have been listed in the simulation config (at the very bottom) -

2022-08-16 18:38:03 INFO     ActorAddr-(T|:45113) => {'addresses': {'blockchain_env.Blockchain': {'address_type': 'environment', 'address': <thespian.actors.ActorAddress object at 0x4019107100>, 'component_class': 'blockchain_env.Blockchain', 'component_number': 1, 'short_name': 'blockchain_env.Blockchain'}, 'proposer.Proposer 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x4019107c10>, 'component_class': 'proposer.Proposer', 'component_number': 1, 'short_name': 'proposer.Proposer 1'}, 'mempool.Mempool 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401910e550>, 'component_class': 'mempool.Mempool', 'component_number': 1, 'short_name': 'mempool.Mempool 1'}, 'transfer.Transfer 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401910ee50>, 'component_class': 'transfer.Transfer', 'component_number': 1, 'short_name': 'transfer.Transfer 1'}, 'account.Account 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x4019120550>, 'component_class': 'account.Account', 'component_number': 1, 'short_name': 'account.Account 1'}, 'amm.AMM 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x4019123490>, 'component_class': 'amm.AMM', 'component_number': 1, 'short_name': 'amm.AMM 1'}, 'ref_market.RefMarket 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401912ab50>, 'component_class': 'ref_market.RefMarket', 'component_number': 1, 'short_name': 'ref_market.RefMarket 1'}, 'price_stability.PriceStability 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401912d340>, 'component_class': 'price_stability.PriceStability', 'component_number': 1, 'short_name': 'price_stability.PriceStability 1'}, 'price_oracle.PriceOracle 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401912dac0>, 'component_class': 'price_oracle.PriceOracle', 'component_number': 1, 'short_name': 'price_oracle.PriceOracle 1'}, 'user.User 1': {'address_type': 'agent', 'address': <thespian.actors.ActorAddress object at 0x4019130040>, 'component_class': 'user.User', 'component_number': 1, 'short_name': 'user.User 1'}, 'user.User 2': {'address_type': 'agent', 'address': <thespian.actors.ActorAddress object at 0x4019130580>, 'component_class': 'user.User', 'component_number': 2, 'short_name': 'user.User 2'}, 'user.User 3': {'address_type': 'agent', 'address': <thespian.actors.ActorAddress object at 0x40191309a0>, 'component_class': 'user.User', 'component_number': 3, 'short_name': 'user.User 3'}, 'user.User 4': {'address_type': 'agent', 'address': <thespian.actors.ActorAddress object at 0x4019130dc0>, 'component_class': 'user.User', 'component_number': 4, 'short_name': 'user.User 4'}}, 'address_groups': {}, 'addresses_to_groups': {}, 'agents': {'user.User 1': {'address_type': 'agent', 'address': <thespian.actors.ActorAddress object at 0x4019130040>, 'component_class': 'user.User', 'component_number': 1, 'short_name': 'user.User 1'}, 'user.User 2': {'address_type': 'agent', 'address': <thespian.actors.ActorAddress object at 0x4019130580>, 'component_class': 'user.User', 'component_number': 2, 'short_name': 'user.User 2'}, 'user.User 3': {'address_type': 'agent', 'address': <thespian.actors.ActorAddress object at 0x40191309a0>, 'component_class': 'user.User', 'component_number': 3, 'short_name': 'user.User 3'}, 'user.User 4': {'address_type': 'agent', 'address': <thespian.actors.ActorAddress object at 0x4019130dc0>, 'component_class': 'user.User', 'component_number': 4, 'short_name': 'user.User 4'}}, 'institutions': {'blockchain_env.Blockchain': {'address_type': 'environment', 'address': <thespian.actors.ActorAddress object at 0x4019107100>, 'component_class': 'blockchain_env.Blockchain', 'component_number': 1, 'short_name': 'blockchain_env.Blockchain'}, 'proposer.Proposer 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x4019107c10>, 'component_class': 'proposer.Proposer', 'component_number': 1, 'short_name': 'proposer.Proposer 1'}, 'mempool.Mempool 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401910e550>, 'component_class': 'mempool.Mempool', 'component_number': 1, 'short_name': 'mempool.Mempool 1'}, 'transfer.Transfer 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401910ee50>, 'component_class': 'transfer.Transfer', 'component_number': 1, 'short_name': 'transfer.Transfer 1'}, 'account.Account 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x4019120550>, 'component_class': 'account.Account', 'component_number': 1, 'short_name': 'account.Account 1'}, 'amm.AMM 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x4019123490>, 'component_class': 'amm.AMM', 'component_number': 1, 'short_name': 'amm.AMM 1'}, 'ref_market.RefMarket 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401912ab50>, 'component_class': 'ref_market.RefMarket', 'component_number': 1, 'short_name': 'ref_market.RefMarket 1'}, 'price_stability.PriceStability 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401912d340>, 'component_class': 'price_stability.PriceStability', 'component_number': 1, 'short_name': 'price_stability.PriceStability 1'}, 'price_oracle.PriceOracle 1': {'address_type': 'institution', 'address': <thespian.actors.ActorAddress object at 0x401912dac0>, 'component_class': 'price_oracle.PriceOracle', 'component_number': 1, 'short_name': 'price_oracle.PriceOracle 1'}}, 'environment': None}

Simulation Config

{
	"mtree_type": "mes_simulation_description",
	"name": "Blockchain",
	"id": "1",
	"environment": "blockchain_env.Blockchain",
	"institutions": [{
			"institution_name": "proposer.Proposer",
			"number": 1
		},
		{
			"institution_name": "mempool.Mempool",
			"number": 1
		},
		{
			"institution_name": "transfer.Transfer",
			"number": 1
		},
		{
			"institution_name": "account.Account",
			"number": 1
		},
		{
			"institution_name": "account.Account",
			"number": 1
		},
		{
			"institution_name": "account.Account",
			"number": 1
		},
		{
			"institution_name": "account.Account",
			"number": 1
		},
		{
			"institution_name": "account.Account",
			"number": 1
		},
		{
			"institution_name": "account.Account",
			"number": 1
		},
		{
			"institution_name": "account.Account",
			"number": 1
		},
		{
			"institution_name": "amm.AMM", 
			"number": 1
		},
		{
			"institution_name": "amm.AMM",
			"number": 1
		},
		{
			"institution_name": "ref_market.RefMarket",
			"number": 1	
		},
		{
			"institution_name": "ref_market.RefMarket",
			"number": 1	
		},
		{
			"institution_name": "ref_market.RefMarket",
			"number": 1	
		},
		{
			"institution_name": "price_stability.PriceStability",
			"number": 1	
		},
		{
			"institution_name": "price_oracle.PriceOracle",
			"number": 1	
		}
	],
	"number_of_runs": 1,
	"agents": [{
		"agent_name": "user.User",
		"number": 4
	}],
	"properties": {
		"brands": ["IST", "ATOM", "OSMO"],
		"account_endowment": {
			"user.User 1": {
				"IST": 500,
				"DOLLARS":100000,
				"USDC": 10000,
				"ATOM": 1000,
				"OSMO": 2000,
				"ATOM_v1": {
					"debt": 505,
					"collat": 1000
				},
				"OSMO_v1": {
					"debt": 0,
					"collat": 0
				}
			},
			"user.User 2": {
				"IST": 500,
				"DOLLARS":100000,
				"USDC": 10000,
				"ATOM": 1000,
				"OSMO": 2000,
				"ATOM_v1": {
					"debt": 505,
					"collat": 1000
				},
				"OSMO_v1": {
					"debt": 0,
					"collat": 0
				}
			},
			"user.User 3": {
				"IST": 500,
				"DOLLARS":100000,
				"USDC": 10000,
				"ATOM": 1000,
				"OSMO": 2000,
				"ATOM_v1": {
					"debt": 505,
					"collat": 1000
				},
				"OSMO_v1": {
					"debt": 0,
					"collat": 0
				}
			},
			"user.User 4": {
				"IST": 500,
				"DOLLARS":100000,
				"USDC": 10000,
				"ATOM": 1000,
				"OSMO": 2000,
				"ATOM_v1": {
					"debt": 505,
					"collat": 1000
				},
				"OSMO_v1": {
					"debt": 0,
					"collat": 0
				}
			},
			"ref_market.RefMarket 13": {
				"IST": 5000,
				"DOLLARS": 500000
			},
			"ref_market.RefMarket 14": {
				"OSMO": 5000,
				"DOLLARS": 500000
			},
			"ref_market.RefMarket 15": {
				"ATOM": 5000,
				"DOLLARS": 500000
			}
		},
		"user_preferences": {
			"user.User 1": {
				"OSMO": {
					"values": [150, 130, 105, 95],
					"steps": [20, 20, 20],
					"prob_of_dividend": 1.0,
					"periodicity": 5
				},
				"ATOM": {
					"values": [110, 105, 90, 70],
					"steps": [20, 20, 20],
					"prob_of_dividend": 1.0,
					"periodicity": 5
				}
			},
			"user.User 2": {
				"OSMO": {
					"values": [160, 120, 75, 20],
					"steps": [20, 20, 20],
					"prob_of_dividend": 1.0,
					"periodicity": 5
				},
				"ATOM": {
					"values": [110, 105, 90, 70],
					"steps": [20, 20, 20],
					"prob_of_dividend": 1.0,
					"periodicity": 5
				}
			},
			"user.User 3": {
				"OSMO": {
					"values": [110, 105, 90, 70],
					"steps": [20, 20, 20],
					"prob_of_dividend": 1.0,
					"periodicity": 5
				},
				"ATOM": {
					"values": [150, 130, 105, 95],
					"steps": [20, 20, 20],
					"prob_of_dividend": 1.0,
					"periodicity": 5
				}
			},
			"user.User 4": {
				"OSMO": {
					"values": [110, 105, 90, 70],
					"steps": [20, 20, 20],
					"prob_of_dividend": 1.0,
					"periodicity": 5
				},
				"ATOM": {
					"values": [160, 120, 75, 20],
					"steps": [20, 20, 20],
					"prob_of_dividend": 1.0,
					"periodicity": 5
				}
			}
		},
		"vault_types": {
			"ATOM_v1": {
				"collateral_brand": "ATOM",
				"collateral_ratio": 1.5,
				"interest_rate": 0.01,
				"min_loan": 1,
				"max_loan": 10000,
				"origination_fee": 0.01,
				"liquidation_penalty": 0.01
			},
			"OSMO_v1": {
				"collateral_brand": "OSMO",
				"collateral_ratio": 1.5,
				"interest_rate": 0.01,
				"min_loan": 1,
				"max_loan": 10000,
				"origination_fee": 0.01,
				"liquidation_penalty": 0.01
			}
		},
		"amm_properties": {
			"amm.AMM 11": {
				"fees": {
					"pool": 0.02,
					"protocol": 0.01
				},
				"IST": 10000,
				"ATOM": 5000
			},
			"amm.AMM 12": {
				"fees": {
					"pool": 0.02,
					"protocol": 0.01
				},
				"IST": 10000,
				"OSMO": 10000
			}
		},
		"ref_properties": {
			"ref_market.RefMarket 13": {
				"brand": "IST",
				"buy_price": 100,
				"sell_price": 100,
				"max_quantity": 5,
				"fees": {
					"buy": 0.02,
					"sell": 0.02,
					"default": 0.01
				},
				"brand_ballance": 10000,
				"dollar_ballance": 10000
			},
			"ref_market.RefMarket 14": {
				"brand": "OSMO",
				"buy_price": 120,
				"sell_price": 130,
				"max_quantity": 5,
				"fees": {
					"buy": 0.02,
					"sell": 0.02,
					"default": 0.01
				},
				"brand_ballance": 10000,
				"dollar_ballance": 10000
			},
			"ref_market.RefMarket 15": {
				"brand": "ATOM",
				"buy_price": 120,
				"sell_price": 130,
				"max_quantity": 5,
				"fees": {
					"buy": 0.02,
					"sell": 0.02,
					"default": 0.01
				},
				"brand_ballance": 10000,
				"dollar_ballance": 10000
			}
		},
		"num_dividend_cohorts": 1,
		"num_commodity_cohorts": 1,
		"num_account_holders": 4,
		"num_ref_markets": 3,
		"gas_fee": 1,
		"block_size": 60,
		"block_time": 6,
		"user_time": 2,
		"simulation_time": 30,
		"oracle_time": 11,
		"price_update_percent": 0.05,
		"price_stability": {
			"usdc_ballance": 100000,
			"psm_fee": 0.05
		},
		"agent_strategies": [{
				"strategy": "Arbitrager",
				"number": 1
			},
			{
				"strategy": "Trader",
				"number": 3
			}
		]
	},
	"data_logging": "json"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.1.5 mTree version
Projects
None yet
Development

No branches or pull requests

1 participant