Discord
@simtotem/dex-demo
Simulation
0
Private

DEX Demo

Please look at the readme file for a list of examples and detailed breakdown of the model and state variables.

DEX Demo

This demo is intended to showcase my knowledge in decentralized exchanges. This simulation has no direct applicability and is only intended as learning and presentation tool. It relies on the Hash AI Uniswap model for basic exchange infrastructure, but makes quality additions to allow for more scale and organic trading (as well as some nice visualizations).

Globals

Since JSON does not allow for comments. Therefore, global variable information can be found here. In general, every agent type is listed at the highest scope level and parameters are passed in arrays to allow for same archetype differentiation.

  • arch: agent archetypes and initial parameters

    • amm: automated market maker parameters
      • dex: a decentralized amm type
        • count: number of amm of this archetype
        • names: the name of every dex amm agent
        • fees: exchange fee percentage
        • pairs: the token pairs every amm will offer along with their respective inventory. format: [{ "id": "a", "qty": 10 }, { "id": "b", "qty": 20 }]
    • trader: trader parameters
      • arb: an arbitrageur type
        • count: number of traders of this archetype
        • names: the name of every arb trader agent
        • costs: the flat cost of every trade which needs to be surpassed profit-wise to be deemed viable
        • risks: the percentage tolerance the trader has per trade (i.e. how much can the trade amount vary from query)
        • waits: range of timesteps to wait between actions to immitate realtime factors
        • batches: how many trade actions to batch at a time (0 means to batch everything everytime)
        • wallets: the tokens of each currency the trader starts with. format: { "a": 10, "b": 10, "c": 10 ... }
    • provider: liquidity provider parameters
      • wave: a periodic liquidity provider
        • count: number of providers of this archetype
        • names: the name of every wave provider agent
        • variances: the percentage fluctuation the providers have per liquidation
        • wallets: the tokens of each currency the provider starts with. format: { "a": 10, "b": 10, "c": 10 ... }
        • targets: a dict of amm along with periodic fluctuation variables
          • key: reference to the amm by name
            • withdrawal_wait: a range of timesteps to wait before withdrawal
            • withdrawal_qty: quantity of liquidity shares to burn per period
            • deposit_wait: a range of timesteps to wait before deposit
            • deposit_qty: quantity of the pegged token to deposit per period
            • deposit_peg: a value between 0 and 2
              • 0: the higher order priority token
              • 1: the lower order priority token
              • 2: randomly choose pegged token every period
  • tokens: the markets tradeable currencies.

    • key: token string identifier
      • name: readable string
      • order: sorting in visualizations and plots
  • peg_token: the token to which all wealth and best/worse price calculations are made relative to

  • viz: 3D viewer visualization parameters

    • flag: whether or not to have a 3D visualization.
    • lanes: which axis line will different archetype classes be distributed on
    • colors: colors of different archetypes and visualization agents.
    • rescale: conversion factor from token quantity to object height.

Agent Archetypes

The simulation's agents are listed here along with their state properties.

  • amm::dex

    • agent_name: the hash AI agent name parameter set in globals.arch.amm.dex.names[i]
    • arch: grouping of all similar type agents (set to "amm" in this case)
    • fee: the amm::dex transaction fee percentage globals.arch.amm.dex.fees[i]
    • pair: the amm::dex tokens supplied on the market along with current inventory state. this is a dictionary with the token id as the key
      • key: globals.arch.amm.dex.pairs[i][0||1].id
        • qty: token quantity
        • price: token price
        • fee_taken: fees collected
        • order: the visualization order of the token globals.tokens[key].order
        • ref: reference to token display agent
    • k: the dex constant calculated by the product of token quantities
    • total_ls: number of dispensed liquidity shares which are a combination of shares generated at initialization and shares disbursed to liquidity provider agents
  • trader::arb

    • agent_name: the hash AI agent name parameter set in globals.arch.trader.arb.names[i]
    • arch: grouping of all similar type agents (set to "trader" in this case)
    • cost: the per trade cost that is taken into account
    • risk: the risk tolerance around expected trade prices
    • wait: a range of timesteps to wait after every trade batch
    • batch: the number of trades the trader can dispatch simultaneously (0 means to batch everything everytime)
    • wallet: the trader::arb tokens owned of all currencies along with some assistive data. this is a dictionary with the token id as the key
      • key: globals.arch.trader.arb.wallets[i].key
        • qty: token quantity
        • order: the visualization order of the token globals.tokens[key].order
        • ref: reference to token display agent
    • amms: a dynamically set list of references to all amm in the market which also contain token pair information to allow the agent to properly query the markets
    • trades: grouped trades made by the trader
    • trade_counter: counts number of trades scheduled; used to assign trade ids
    • path: set of trades to execute in an arbitrage sequence
    • status: the current activity the trader is engaging in
    • timer: the countdown of timesteps before next action
  • provider::wave

    • agent_name: the hash AI agent name parameter set in globals.arch.provider.wave.names[i]
    • arch: grouping of all similar type agents (set to "provider" in this case)
    • variance: the normal random percentage fluctuation the provider has per liquidation
    • wallet: the trader::arb tokens owned of all currencies along with some assistive data. this is a dictionary with the token id as the key
      • key: globals.arch.provider.wave.wallets[i].key
        • qty: token quantity
        • order: the visualization order of the token globals.tokens[key].order
        • ref: reference to token display agent
    • targets: a dict of amm along with periodic fluctuation variables
      • key: reference to the amm by name
        • withdrawal_wait: a range of timesteps to wait before withdrawal
        • withdrawal_qty: quantity of liquidity shares to burn per period
        • deposit_wait: a range of timesteps to wait before deposit
        • deposit_qty: quantity of the pegged token to deposit per period
        • deposit_peg: a value between 0 and 2 for selecting the pegged token
        • peg_tkn: the currently used peg token (alters if using deposit_peg == 2)
        • alt_tkn: the currently unpegged token (alters if using deposit_peg == 2)
        • ls_qty: quantity of liquidity shares
        • status: the current stage in this target's periodic cycle
        • timer: the countdown of timesteps before next action
    • amms: a dynamically set list of references to all amm in the market which also contain token pair information to allow the agent to properly query the markets
    • liquidations: grouped liquidations made by the provider
    • liquidation_counter: counts number of trades scheduled; used to assign trade ids
  • token

    • agent_name: the hash AI agent name set to '{}_token_{}'.format(amm.agent_name, token_id)
    • arch: grouping of all similar type agents (set to "token" in this case)
    • parent: reference to parent source agent
    • token_id: the token id of the market currency
    • scale: the z value is used to represent the token amount owned by the parent

Code Notes

  • All _in/from_ and _out/into_ variable names are relative to the amms inventory, not the agent who runs the code.
  • All token agents have their search_radius set to the max z axis size of the topology.
  • All non visualization agents have a token_viz_data dict that informs token agents how to reposition and resize every timestep.
  • channel_viz_data is similar in that it helps inform channels on how to recolor themselves every timestep

Simulation Runs and Analyses

This section provides a sequence of initial variables and accomanying analysis views that are meant to educate on decentralized exchanges and arbitrage trading. I hope that analyses could be dynamically generated in the future, but for now each run will have its global variables and its accompanying analysis here which must be copy pasted into globals.json and analysis.json respectively.

Just a Automated Market Maker

Here you have a single Constant Product AMM (the most commonly used DEX algorithm) that holds a pair of currencies. The currencies are priced based on an constant k that is calculated by __ k = a * b __. This means it trades on a vs. b curve that always maintains the invariant k regardless of the currency ratio. It won't do much here because there are no market players.

globals.json

{ 
  "arch": {
    "amm": {
      "dex": {
        "count": 1,
        "names": ["amm_1"],
        "fees": [0.002],
        "pairs": [
          [{ "id": "a", "qty": 70 }, { "id": "b", "qty": 30 }]
        ]
      }
    },
    "trader": {
      "arb": {
        "count": 0,
        "names": [],
        "costs": [],
        "risks": [],
        "waits": [],
        "batches": [],
        "wallets": [
        ]
      }
    },
    "provider": {
      "wave": {
        "count": 0,
        "names": [],
        "variances": [],
        "wallets": [
        ],
        "targets": [
        ]
      }
    }
  },
  "tokens": {
    "a": {
      "name": "token_a",
      "order": 0
    },
    "b": {
      "name": "token_b",
      "order": 1
    }
  },
  "peg_token": "a",
  "viz": {
    "flag": true,
    "lanes": {
      "amm": 8,
      "trader": 2,
      "provider": 14
    },
    "colors": {
      "dex": "red",
      "arb": "yellow",
      "wave": "orange",
      "a": "blue",
      "b": "green",
      "c": "purple",
      "channel": "grey"
    },
    "rescale": 0.1
  },
  "topology": {
    "x_bounds": [0, 16],
    "y_bounds": [0, 16],
    "z_bounds": [0, 50]
  }
}

analysis.json

{
  "outputs": {
    "tkn_a_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_a_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_b_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_b_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],

    "amm_1_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ]
  },

  "plots": [
    {
      "title": "Market Prices",
      "type": "timeseries",
      "data": [
        {"y": "tkn_a_best_price", "name": "tkn_a_best"},
        {"y": "tkn_a_worst_price", "name": "tkn_a_worst"},
        {"y": "tkn_b_best_price", "name": "tkn_b_best"},
        {"y": "tkn_b_worst_price", "name": "tkn_b_worst"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_qty", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_qty", "name": "amm_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Prices",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_price", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_price", "name": "amm_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Wealth",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_max_wealth", "name": "amm_1_max"},
        {"y": "amm_1_min_wealth", "name": "amm_1_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Fees",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_fees", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_fees", "name": "amm_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Total Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_total_ls", "name": "amm_1_ls"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    }
  ]
}

Welcome the Liquidity Provider

Decentralized exchanges introduce a new type of player in the markets called a liquidity providers. They can be viewed as investors in AMM. When interested in a particular AMM liquidity pool, they deposit tokens in the exact ratio found in the liquidity pool at that moment. In return, they receive liquidity shares which represent their percentage ownership of the tokens in the pool. Liquidity providers make a return on their investment through the swap fees collected by the AMM. When ready to cash out, providers burn their liquidity shares in order to withdraw their proportion of the liquidity pool.

This model currently only provides a periodic provider that is preprogrammed to deposit and withdraw from AMM at predefined quantities and cycles. Therefore, it is not greedy in any way and is just present to show how the markets are impacted by the addition and subtraction of liquidity. Finance is now intrigued by liquidity providers and curious to discover ways to profitably use these new market player types.

You will also notice the connectind edge in the 3D viewer which changes colors based on the interactions between a market and a player. Below is a color guide to the channel colors:

  • purple: a player has queried a market for a trade or liquidiation
  • blue: the market has computed and returned the result of a player's query
  • yellow: a player has sent in a request for a trade or a liquidation
  • green: the market has successful settled a trade or liquidation with a player
  • red: the market was not able to fulfill the a trade or liquidation with a player

In the analysis view, you will notice an oscillating step function. The function trends based on the difference between set withdrawal and deposit quantities. It fluctuates based on the variance amount set as well as the randomize peg token setting.

globals.json

{ 
  "arch": {
    "amm": {
      "dex": {
        "count": 1,
        "names": ["amm_1"],
        "fees": [0.002],
        "pairs": [
          [{ "id": "a", "qty": 70 }, { "id": "b", "qty": 30 }]
        ]
      }
    },
    "trader": {
      "arb": {
        "count": 0,
        "names": [],
        "costs": [],
        "risks": [],
        "waits": [],
        "batches": [],
        "wallets": [
        ]
      }
    },
    "provider": {
      "wave": {
        "count": 1,
        "names": ["wave_1"],
        "variances": [0.1],
        "wallets": [
          { "a": 20, "b": 20}
        ],
        "targets": [
          {
            "amm_1": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            }
          }
        ]
      }
    }
  },
  "tokens": {
    "a": {
      "name": "token_a",
      "order": 0
    },
    "b": {
      "name": "token_b",
      "order": 1
    }
  },
  "peg_token": "a",
  "viz": {
    "flag": true,
    "lanes": {
      "amm": 8,
      "trader": 2,
      "provider": 14
    },
    "colors": {
      "dex": "red",
      "arb": "yellow",
      "wave": "orange",
      "a": "blue",
      "b": "green",
      "c": "purple",
      "channel": "grey"
    },
    "rescale": 0.1
  },
  "topology": {
    "x_bounds": [0, 16],
    "y_bounds": [0, 16],
    "z_bounds": [0, 50]
  }
}

analysis.json

{
  "outputs": {
    "tkn_a_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_a_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_b_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_b_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],


    "amm_1_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "wave_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ]
  },

  "plots": [
    {
      "title": "Market Prices",
      "type": "timeseries",
      "data": [
        {"y": "tkn_a_best_price", "name": "tkn_a_best"},
        {"y": "tkn_a_worst_price", "name": "tkn_a_worst"},
        {"y": "tkn_b_best_price", "name": "tkn_b_best"},
        {"y": "tkn_b_worst_price", "name": "tkn_b_worst"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "AMM Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_qty", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_qty", "name": "amm_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Prices",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_price", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_price", "name": "amm_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Wealth",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_max_wealth", "name": "amm_1_max"},
        {"y": "amm_1_min_wealth", "name": "amm_1_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Fees",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_fees", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_fees", "name": "amm_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Total Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_total_ls", "name": "amm_1_ls"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Provider Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_tkn_a_qty", "name": "wave_1_tkn_a"},
        {"y": "wave_1_tkn_b_qty", "name": "wave_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
        {
      "title": "Provider Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_amm_1_ls_qty", "name": "wave_1_amm_1"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Provider Wealth",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_max_wealth", "name": "wave_1_max"},
        {"y": "wave_1_min_wealth", "name": "wave_1_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    }

  ]
}

Welcome the Arbitrageur

In this setup, we forego the provider to showcase the arbitrage trader. An arbitrageur profits from price inefficiencies in the market. Normally, inefficiencies are constantly introduced and rectified, however given that the only trader is an arbitrageur, the only inefficency is introduced by the initial price conditions of the 2 AMM (there is nothing to arbitrage with a single AMM).

The arbitrageur does not size trades (trades 1 token at a time) and uses the bellman-ford algorithm to search for negative cycles in a negative-log-price multi-directed-graph. So although it can perfectly discover new opportunities, it does not weigh its profitability yet.

The model provides lots of variables that can configure the behavior of the trader, and add/remove realism from the simulation. An external trade cost can be factored into every arbitrage search. A risk factor can allow the trader to take riskier trades and have more leniency in what trades it deems acceptable. The wait and batch size variables can impact the time action and response of the trader.

Run Cases

  • Inverted AMMs i-amm
  • Aligned AMMs a-amm

globals.json

{ 
  "arch": {
    "amm": {
      "dex": {
        "count": 2,
        "names": ["amm_1", "amm_2"],
        "fees": [0.003, 0.002],
        "pairs": [
          [{ "id": "a", "qty": 80 }, { "id": "b", "qty": 20 }],
          [{ "id": "a", "qty": 60 }, { "id": "b", "qty": 40 }]
        ]
      }
    },
    "trader": {
      "arb": {
        "count": 1,
        "names": ["arb_1"],
        "costs": [0.0],
        "risks": [0.0],
        "waits": [[0, 2]],
        "batches": [1],
        "wallets": [
          { "a": 20, "b": 20}
        ]
      }
    },
    "provider": {
      "wave": {
        "count": 0,
        "names": ["wave_1"],
        "variances": [0.1],
        "wallets": [
          { "a": 20, "b": 20}
        ],
        "targets": [
          {
            "amm_1": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            }
          }
        ]
      }
    }
  },
  "tokens": {
    "a": {
      "name": "token_a",
      "order": 0
    },
    "b": {
      "name": "token_b",
      "order": 1
    }
  },
  "peg_token": "a",
  "viz": {
    "flag": true,
    "lanes": {
      "amm": 8,
      "trader": 2,
      "provider": 14
    },
    "colors": {
      "dex": "red",
      "arb": "yellow",
      "wave": "orange",
      "a": "blue",
      "b": "green",
      "c": "purple",
      "channel": "grey"
    },
    "rescale": 0.1
  },
  "topology": {
    "x_bounds": [0, 16],
    "y_bounds": [0, 16],
    "z_bounds": [0, 50]
  }
}

analysis.json

{
  "outputs": {
    "tkn_a_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_a_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_b_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_b_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],


    "amm_1_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_2_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "arb_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "arb_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "wave_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ]
  },

  "plots": [
    {
      "title": "Market Prices",
      "type": "timeseries",
      "data": [
        {"y": "tkn_a_best_price", "name": "tkn_a_best"},
        {"y": "tkn_a_worst_price", "name": "tkn_a_worst"},
        {"y": "tkn_b_best_price", "name": "tkn_b_best"},
        {"y": "tkn_b_worst_price", "name": "tkn_b_worst"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "AMM Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_qty", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_qty", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_qty", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_qty", "name": "amm_2_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Prices",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_price", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_price", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_price", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_price", "name": "amm_2_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Wealth",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_max_wealth", "name": "amm_1_max"},
        {"y": "amm_1_min_wealth", "name": "amm_1_min"},
        {"y": "amm_2_max_wealth", "name": "amm_2_max"},
        {"y": "amm_2_min_wealth", "name": "amm_2_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Fees",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_fees", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_fees", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_fees", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_fees", "name": "amm_2_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Total Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_total_ls", "name": "amm_1_ls"},
        {"y": "amm_2_total_ls", "name": "amm_2_ls"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Trader Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_tkn_a_qty", "name": "arb_1_tkn_a"},
        {"y": "arb_1_tkn_b_qty", "name": "arb_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Trader Wealth",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_max_wealth", "name": "arb_1_max"},
        {"y": "arb_1_min_wealth", "name": "arb_1_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    }
  ]
}

Minimum Decentralized Exchange

Run Cases

  • Inverted AMMs i-amm
  • Aligned AMMs a-amm
  • All AMM LP
  • Single AMM LP

globals.json

{ 
  "arch": {
    "amm": {
      "dex": {
        "count": 2,
        "names": ["amm_1", "amm_2"],
        "fees": [0.003, 0.002],
        "pairs": [
          [{ "id": "a", "qty": 80 }, { "id": "b", "qty": 20 }],
          [{ "id": "a", "qty": 60 }, { "id": "b", "qty": 40 }]
        ]
      }
    },
    "trader": {
      "arb": {
        "count": 1,
        "names": ["arb_1"],
        "costs": [0.0],
        "risks": [0.0],
        "waits": [[0, 2]],
        "batches": [1],
        "wallets": [
          { "a": 20, "b": 20}
        ]
      }
    },
    "provider": {
      "wave": {
        "count": 1,
        "names": ["wave_1"],
        "variances": [0.1],
        "wallets": [
          { "a": 20, "b": 20}
        ],
        "targets": [
          {
            "amm_1": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            }
          }
        ]
      }
    }
  },
  "tokens": {
    "a": {
      "name": "token_a",
      "order": 0
    },
    "b": {
      "name": "token_b",
      "order": 1
    }
  },
  "peg_token": "a",
  "viz": {
    "flag": true,
    "lanes": {
      "amm": 8,
      "trader": 2,
      "provider": 14
    },
    "colors": {
      "dex": "red",
      "arb": "yellow",
      "wave": "orange",
      "a": "blue",
      "b": "green",
      "c": "purple",
      "channel": "grey"
    },
    "rescale": 0.1
  },
  "topology": {
    "x_bounds": [0, 16],
    "y_bounds": [0, 16],
    "z_bounds": [0, 50]
  }
}

analysis.json

{
  "outputs": {
    "tkn_a_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_a_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_b_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_b_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],


    "amm_1_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_2_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "arb_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "arb_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "wave_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ]
  },

  "plots": [
    {
      "title": "Market Prices",
      "type": "timeseries",
      "data": [
        {"y": "tkn_a_best_price", "name": "tkn_a_best"},
        {"y": "tkn_a_worst_price", "name": "tkn_a_worst"},
        {"y": "tkn_b_best_price", "name": "tkn_b_best"},
        {"y": "tkn_b_worst_price", "name": "tkn_b_worst"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "AMM Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_qty", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_qty", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_qty", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_qty", "name": "amm_2_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Prices",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_price", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_price", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_price", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_price", "name": "amm_2_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Wealth",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_max_wealth", "name": "amm_1_max"},
        {"y": "amm_1_min_wealth", "name": "amm_1_min"},
        {"y": "amm_2_max_wealth", "name": "amm_2_max"},
        {"y": "amm_2_min_wealth", "name": "amm_2_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Fees",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_fees", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_fees", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_fees", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_fees", "name": "amm_2_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Total Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_total_ls", "name": "amm_1_ls"},
        {"y": "amm_2_total_ls", "name": "amm_2_ls"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Trader Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_tkn_a_qty", "name": "arb_1_tkn_a"},
        {"y": "arb_1_tkn_b_qty", "name": "arb_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Trader Wealth",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_max_wealth", "name": "arb_1_max"},
        {"y": "arb_1_min_wealth", "name": "arb_1_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Provider Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_tkn_a_qty", "name": "wave_1_tkn_a"},
        {"y": "wave_1_tkn_b_qty", "name": "wave_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
        {
      "title": "Provider Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_amm_1_ls_qty", "name": "wave_1_amm_1"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Provider Wealth",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_max_wealth", "name": "wave_1_max"},
        {"y": "wave_1_min_wealth", "name": "wave_1_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    }

  ]
}

Showing Liquidity Provider Competition

Run Cases

  • Inverted AMMs (i-amm, a-amm, a-amm)
  • Aligned AMMs (a-amm, a-amm, a-amm)
  • Patient LP p-lp
  • Impatient LP i-lp

globals.json

{ 
  "arch": {
    "amm": {
      "dex": {
        "count": 3,
        "names": ["amm_1", "amm_2", "amm_3"],
        "fees": [0.003, 0.002, 0.003],
        "pairs": [
          [{ "id": "a", "qty": 80 }, { "id": "b", "qty": 20 }],
          [{ "id": "a", "qty": 40 }, { "id": "b", "qty": 60 }],
          [{ "id": "a", "qty": 30 }, { "id": "b", "qty": 70 }]
        ]
      }
    },
    "trader": {
      "arb": {
        "count": 1,
        "names": ["arb_1"],
        "costs": [0.0],
        "risks": [0.0],
        "waits": [[0, 2]],
        "batches": [1],
        "wallets": [
          { "a": 30, "b": 30 }
        ]
      }
    },
    "provider": {
      "wave": {
        "count": 2,
        "names": ["wave_1", "wave_2"],
        "variances": [0.1, 0.1],
        "wallets": [
          { "a": 20, "b": 20 },
          { "a": 20, "b": 20 }
        ],
        "targets": [
          {
            "amm_1": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_2": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_3": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            }
          },
          {
            "amm_1": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_2": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_3": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 0
            }
          }
        ]
      }
    }
  },
  "tokens": {
    "a": {
      "name": "token_a",
      "order": 0
    },
    "b": {
      "name": "token_b",
      "order": 1
    }
  },
  "peg_token": "a",
  "viz": {
    "flag": true,
    "lanes": {
      "amm": 8,
      "trader": 2,
      "provider": 14
    },
    "colors": {
      "dex": "red",
      "arb": "yellow",
      "wave": "orange",
      "a": "blue",
      "b": "green",
      "c": "purple",
      "channel": "grey"
    },
    "rescale": 0.1
  },
  "topology": {
    "x_bounds": [0, 16],
    "y_bounds": [0, 16],
    "z_bounds": [0, 50]
  }
}

analysis.json

{
  "outputs": {
    "tkn_a_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_a_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_b_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_b_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],


    "amm_1_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_2_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_3_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_3_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_3_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_3_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_3_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_3_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "arb_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "arb_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "wave_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_2_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_3_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "wave_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_2_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_3_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ]
  },

  "plots": [
    {
      "title": "Market Prices",
      "type": "timeseries",
      "data": [
        {"y": "tkn_a_best_price", "name": "tkn_a_best"},
        {"y": "tkn_a_worst_price", "name": "tkn_a_worst"},
        {"y": "tkn_b_best_price", "name": "tkn_b_best"},
        {"y": "tkn_b_worst_price", "name": "tkn_b_worst"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "AMM Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_qty", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_qty", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_qty", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_qty", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_a_qty", "name": "amm_3_tkn_a"},
        {"y": "amm_3_tkn_b_qty", "name": "amm_3_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Prices",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_price", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_price", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_price", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_price", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_a_price", "name": "amm_3_tkn_a"},
        {"y": "amm_3_tkn_b_price", "name": "amm_3_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Wealth",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_max_wealth", "name": "amm_1_max"},
        {"y": "amm_1_min_wealth", "name": "amm_1_min"},
        {"y": "amm_2_max_wealth", "name": "amm_2_max"},
        {"y": "amm_2_min_wealth", "name": "amm_2_min"},
        {"y": "amm_3_max_wealth", "name": "amm_3_max"},
        {"y": "amm_3_min_wealth", "name": "amm_3_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Fees",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_fees", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_fees", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_fees", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_fees", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_a_fees", "name": "amm_3_tkn_a"},
        {"y": "amm_3_tkn_b_fees", "name": "amm_3_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Total Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_total_ls", "name": "amm_1_ls"},
        {"y": "amm_2_total_ls", "name": "amm_2_ls"},
        {"y": "amm_3_total_ls", "name": "amm_3_ls"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Trader Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_tkn_a_qty", "name": "arb_1_tkn_a"},
        {"y": "arb_1_tkn_b_qty", "name": "arb_1_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Trader Wealth",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_max_wealth", "name": "arb_1_max"},
        {"y": "arb_1_min_wealth", "name": "arb_1_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Provider Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_tkn_a_qty", "name": "wave_1_tkn_a"},
        {"y": "wave_1_tkn_b_qty", "name": "wave_1_tkn_b"},
        {"y": "wave_2_tkn_a_qty", "name": "wave_2_tkn_a"},
        {"y": "wave_2_tkn_b_qty", "name": "wave_2_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
        {
      "title": "Provider Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_amm_1_ls_qty", "name": "wave_1_amm_1"},
        {"y": "wave_1_amm_2_ls_qty", "name": "wave_1_amm_2"},
        {"y": "wave_1_amm_3_ls_qty", "name": "wave_1_amm_3"},
        {"y": "wave_2_amm_1_ls_qty", "name": "wave_2_amm_1"},
        {"y": "wave_2_amm_2_ls_qty", "name": "wave_2_amm_2"},
        {"y": "wave_2_amm_3_ls_qty", "name": "wave_2_amm_3"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Provider Wealth",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_max_wealth", "name": "wave_1_max"},
        {"y": "wave_1_min_wealth", "name": "wave_1_min"},
        {"y": "wave_2_max_wealth", "name": "wave_2_max"},
        {"y": "wave_2_min_wealth", "name": "wave_2_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    }

  ]
}

Showing Trader Competition

Run Cases

  • Inverted AMMs (i-amm, a-amm, a-amm)
  • Aligned AMMs (a-amm, a-amm, a-amm)
  • Fast Slow Traders fs-t
  • Equal Speed Traders es-t

globals.json

{ 
  "arch": {
    "amm": {
      "dex": {
        "count": 3,
        "names": ["amm_1", "amm_2", "amm_3"],
        "fees": [0.003, 0.002, 0.003],
        "pairs": [
          [{ "id": "a", "qty": 90 }, { "id": "b", "qty": 10 }],
          [{ "id": "a", "qty": 70 }, { "id": "b", "qty": 30 }],
          [{ "id": "a", "qty": 50 }, { "id": "b", "qty": 50 }]
        ]
      }
    },
    "trader": {
      "arb": {
        "count": 2,
        "names": ["arb_1", "arb_2"],
        "costs": [0.0, 0.0],
        "risks": [0.0, 0.0],
        "waits": [[0, 3], [3, 6]],
        "batches": [1, 1],
        "wallets": [
          { "a": 20, "b": 20 },
          { "a": 20, "b": 20 }
        ]
      }
    },
    "provider": {
      "wave": {
        "count": 2,
        "names": ["wave_1", "wave_2"],
        "variances": [0.1, 0.1],
        "wallets": [
          { "a": 20, "b": 20 },
          { "a": 20, "b": 20 }
        ],
        "targets": [
          {
            "amm_1": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_2": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_3": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            }
          },
          {
            "amm_1": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_2": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_3": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 0
            }
          }
        ]
      }
    }
  },
  "tokens": {
    "a": {
      "name": "token_a",
      "order": 0
    },
    "b": {
      "name": "token_b",
      "order": 1
    }
  },
  "peg_token": "a",
  "viz": {
    "flag": true,
    "lanes": {
      "amm": 8,
      "trader": 2,
      "provider": 14
    },
    "colors": {
      "dex": "red",
      "arb": "yellow",
      "wave": "orange",
      "a": "blue",
      "b": "green",
      "c": "purple",
      "channel": "grey"
    },
    "rescale": 0.1
  },
  "topology": {
    "x_bounds": [0, 16],
    "y_bounds": [0, 16],
    "z_bounds": [0, 50]
  }
}

analysis.json

{
  "outputs": {
    "tkn_a_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_a_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_b_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_b_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],


    "amm_1_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_2_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_3_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_3_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_3_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_3_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_3_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_3_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "arb_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "arb_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "arb_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "arb_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "wave_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_2_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_3_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "wave_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_2_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_3_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ]
  },

  "plots": [
    {
      "title": "Market Prices",
      "type": "timeseries",
      "data": [
        {"y": "tkn_a_best_price", "name": "tkn_a_best"},
        {"y": "tkn_a_worst_price", "name": "tkn_a_worst"},
        {"y": "tkn_b_best_price", "name": "tkn_b_best"},
        {"y": "tkn_b_worst_price", "name": "tkn_b_worst"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "AMM Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_qty", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_qty", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_qty", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_qty", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_a_qty", "name": "amm_3_tkn_a"},
        {"y": "amm_3_tkn_b_qty", "name": "amm_3_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Prices",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_price", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_price", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_price", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_price", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_a_price", "name": "amm_3_tkn_a"},
        {"y": "amm_3_tkn_b_price", "name": "amm_3_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Wealth",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_max_wealth", "name": "amm_1_max"},
        {"y": "amm_1_min_wealth", "name": "amm_1_min"},
        {"y": "amm_2_max_wealth", "name": "amm_2_max"},
        {"y": "amm_2_min_wealth", "name": "amm_2_min"},
        {"y": "amm_3_max_wealth", "name": "amm_3_max"},
        {"y": "amm_3_min_wealth", "name": "amm_3_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Fees",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_fees", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_fees", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_fees", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_fees", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_a_fees", "name": "amm_3_tkn_a"},
        {"y": "amm_3_tkn_b_fees", "name": "amm_3_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Total Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_total_ls", "name": "amm_1_ls"},
        {"y": "amm_2_total_ls", "name": "amm_2_ls"},
        {"y": "amm_3_total_ls", "name": "amm_3_ls"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Trader Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_tkn_a_qty", "name": "arb_1_tkn_a"},
        {"y": "arb_1_tkn_b_qty", "name": "arb_1_tkn_b"},
        {"y": "arb_2_tkn_a_qty", "name": "arb_2_tkn_a"},
        {"y": "arb_2_tkn_b_qty", "name": "arb_2_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Trader Wealth",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_max_wealth", "name": "arb_1_max"},
        {"y": "arb_1_min_wealth", "name": "arb_1_min"},
        {"y": "arb_2_max_wealth", "name": "arb_2_max"},
        {"y": "arb_2_min_wealth", "name": "arb_2_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Provider Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_tkn_a_qty", "name": "wave_1_tkn_a"},
        {"y": "wave_1_tkn_b_qty", "name": "wave_1_tkn_b"},
        {"y": "wave_2_tkn_a_qty", "name": "wave_2_tkn_a"},
        {"y": "wave_2_tkn_b_qty", "name": "wave_2_tkn_b"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
        {
      "title": "Provider Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_amm_1_ls_qty", "name": "wave_1_amm_1"},
        {"y": "wave_1_amm_2_ls_qty", "name": "wave_1_amm_2"},
        {"y": "wave_1_amm_3_ls_qty", "name": "wave_1_amm_3"},
        {"y": "wave_2_amm_1_ls_qty", "name": "wave_2_amm_1"},
        {"y": "wave_2_amm_2_ls_qty", "name": "wave_2_amm_2"},
        {"y": "wave_2_amm_3_ls_qty", "name": "wave_2_amm_3"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Provider Wealth",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_max_wealth", "name": "wave_1_max"},
        {"y": "wave_1_min_wealth", "name": "wave_1_min"},
        {"y": "wave_2_max_wealth", "name": "wave_2_max"},
        {"y": "wave_2_min_wealth", "name": "wave_2_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    }

  ]
}

Introducing a New Token

Run Cases

  • AMM pairs:
    • (a-amm, a-amm)
    • (i-amm, a-amm)
    • (i-amm, i-amm)
  • Fast Slow Traders fs-t
  • Equal Speed Traders es-t
  • Same Pair LPs sp-lp
  • Cross Pair LPs cp-lp (Remember to change liquidity share plots accordingly)

globals.json

{ 
  "arch": {
    "amm": {
      "dex": {
        "count": 4,
        "names": ["amm_1", "amm_2", "amm_3", "amm_4"],
        "fees": [0.003, 0.002, 0.003, 0.004],
        "pairs": [
          [{ "id": "a", "qty": 90 }, { "id": "b", "qty": 10 }],
          [{ "id": "a", "qty": 60 }, { "id": "b", "qty": 40 }],
          [{ "id": "b", "qty": 70 }, { "id": "c", "qty": 30 }],
          [{ "id": "b", "qty": 50 }, { "id": "c", "qty": 50 }]
        ]
      }
    },
    "trader": {
      "arb": {
        "count": 2,
        "names": ["arb_1", "arb_2"],
        "costs": [0.0, 0.0],
        "risks": [0.0, 0.0],
        "waits": [[0, 3], [0, 3]],
        "batches": [1, 1],
        "wallets": [
          { "a": 15, "b": 20, "c": 15 },
          { "a": 15, "b": 20, "c": 15 }
        ]
      }
    },
    "provider": {
      "wave": {
        "count": 2,
        "names": ["wave_1", "wave_2"],
        "variances": [0.1, 0.1],
        "wallets": [
          { "a": 15, "b": 20, "c": 15 },
          { "a": 15, "b": 20, "c": 15 }
        ],
        "targets": [
          {
            "amm_1": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_2": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            }
          },
          {
            "amm_3": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 1
            },
            "amm_4": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 1
            }
          }
        ]
      }
    }
  },
  "tokens": {
    "a": {
      "name": "token_a",
      "order": 0
    },
    "b": {
      "name": "token_b",
      "order": 1
    },
    "c": {
      "name": "token_c",
      "order": 2
    }
  },
  "peg_token": "a",
  "viz": {
    "flag": true,
    "lanes": {
      "amm": 8,
      "trader": 2,
      "provider": 14
    },
    "colors": {
      "dex": "red",
      "arb": "yellow",
      "wave": "orange",
      "a": "blue",
      "b": "green",
      "c": "purple",
      "channel": "grey"
    },
    "rescale": 0.1
  },
  "topology": {
    "x_bounds": [0, 16],
    "y_bounds": [0, 16],
    "z_bounds": [0, 50]
  }
}

analysis.json

{
  "outputs": {
    "tkn_a_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_a_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_b_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_b_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_c_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_c_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],


    "amm_1_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_2_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_3_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_3_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_3_tkn_c_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_3_tkn_c_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_3_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_3_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_4_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_4_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_4_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_4_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_4_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_4_tkn_c_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_4_tkn_c_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_4_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_4"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_4_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_4"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "arb_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "arb_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "arb_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_2_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "arb_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "wave_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_2_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_3_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_4_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_4"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "wave_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_2_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_3_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_4_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_4"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ]
  },

  "plots": [
    {
      "title": "Market Prices",
      "type": "timeseries",
      "data": [
        {"y": "tkn_a_best_price", "name": "tkn_a_best"},
        {"y": "tkn_a_worst_price", "name": "tkn_a_worst"},
        {"y": "tkn_b_best_price", "name": "tkn_b_best"},
        {"y": "tkn_b_worst_price", "name": "tkn_b_worst"},
        {"y": "tkn_c_best_price", "name": "tkn_c_best"},
        {"y": "tkn_c_worst_price", "name": "tkn_c_worst"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "AMM Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_qty", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_qty", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_qty", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_qty", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_b_qty", "name": "amm_3_tkn_b"},
        {"y": "amm_3_tkn_c_qty", "name": "amm_3_tkn_c"},
        {"y": "amm_4_tkn_b_qty", "name": "amm_4_tkn_b"},
        {"y": "amm_4_tkn_c_qty", "name": "amm_4_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Prices",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_price", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_price", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_price", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_price", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_b_price", "name": "amm_3_tkn_b"},
        {"y": "amm_3_tkn_c_price", "name": "amm_3_tkn_c"},
        {"y": "amm_4_tkn_b_price", "name": "amm_4_tkn_b"},
        {"y": "amm_4_tkn_c_price", "name": "amm_4_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Wealth",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_max_wealth", "name": "amm_1_max"},
        {"y": "amm_1_min_wealth", "name": "amm_1_min"},
        {"y": "amm_2_max_wealth", "name": "amm_2_max"},
        {"y": "amm_2_min_wealth", "name": "amm_2_min"},
        {"y": "amm_3_max_wealth", "name": "amm_3_max"},
        {"y": "amm_3_min_wealth", "name": "amm_3_min"},
        {"y": "amm_4_max_wealth", "name": "amm_4_max"},
        {"y": "amm_4_min_wealth", "name": "amm_4_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Fees",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_fees", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_fees", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_fees", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_fees", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_b_fees", "name": "amm_3_tkn_b"},
        {"y": "amm_3_tkn_c_fees", "name": "amm_3_tkn_c"},
        {"y": "amm_4_tkn_b_fees", "name": "amm_4_tkn_b"},
        {"y": "amm_4_tkn_c_fees", "name": "amm_4_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Total Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_total_ls", "name": "amm_1_ls"},
        {"y": "amm_2_total_ls", "name": "amm_2_ls"},
        {"y": "amm_3_total_ls", "name": "amm_3_ls"},
        {"y": "amm_4_total_ls", "name": "amm_4_ls"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Trader Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_tkn_a_qty", "name": "arb_1_tkn_a"},
        {"y": "arb_1_tkn_b_qty", "name": "arb_1_tkn_b"},
        {"y": "arb_1_tkn_c_qty", "name": "arb_1_tkn_c"},
        {"y": "arb_2_tkn_a_qty", "name": "arb_2_tkn_a"},
        {"y": "arb_2_tkn_b_qty", "name": "arb_2_tkn_b"},
        {"y": "arb_2_tkn_c_qty", "name": "arb_2_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Trader Wealth",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_max_wealth", "name": "arb_1_max"},
        {"y": "arb_1_min_wealth", "name": "arb_1_min"},
        {"y": "arb_2_max_wealth", "name": "arb_2_max"},
        {"y": "arb_2_min_wealth", "name": "arb_2_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Provider Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_tkn_a_qty", "name": "wave_1_tkn_a"},
        {"y": "wave_1_tkn_b_qty", "name": "wave_1_tkn_b"},
        {"y": "wave_1_tkn_c_qty", "name": "wave_1_tkn_c"},
        {"y": "wave_2_tkn_a_qty", "name": "wave_2_tkn_a"},
        {"y": "wave_2_tkn_b_qty", "name": "wave_2_tkn_b"},
        {"y": "wave_2_tkn_c_qty", "name": "wave_2_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
        {
      "title": "Provider Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_amm_1_ls_qty", "name": "wave_1_amm_1"},
        {"y": "wave_1_amm_2_ls_qty", "name": "wave_1_amm_2"},
        {"y": "wave_2_amm_3_ls_qty", "name": "wave_2_amm_3"},
        {"y": "wave_2_amm_4_ls_qty", "name": "wave_2_amm_4"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Provider Wealth",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_max_wealth", "name": "wave_1_max"},
        {"y": "wave_1_min_wealth", "name": "wave_1_min"},
        {"y": "wave_2_max_wealth", "name": "wave_2_max"},
        {"y": "wave_2_min_wealth", "name": "wave_2_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    }

  ]
}

Balanced Exchange Distribution with 3 Tokens

Run Cases

  • AMM pairs:
    • (a-amm, a-amm, a-amm)
    • (i-amm, a-amm, a-amm)
    • (i-amm, i-amm, a-amm)
    • (i-amm, i-amm, i-amm)
  • Fast Slow Traders fs-t
  • Equal Speed Traders es-t
  • Same Pair LPs sp-lp
  • Cross Pair LPs cp-lp (Remember to change liquidity share plots accordingly and remove 1 LP)

globals.json

{ 
  "arch": {
    "amm": {
      "dex": {
        "count": 6,
        "names": ["amm_1", "amm_2", "amm_3", "amm_4", "amm_5", "amm_6"],
        "fees": [0.003, 0.002, 0.003, 0.004, 0.003, 0.002],
        "pairs": [
          [{ "id": "a", "qty": 90 }, { "id": "b", "qty": 10 }],
          [{ "id": "a", "qty": 60 }, { "id": "b", "qty": 40 }],
          [{ "id": "b", "qty": 70 }, { "id": "c", "qty": 30 }],
          [{ "id": "b", "qty": 50 }, { "id": "c", "qty": 50 }],
          [{ "id": "a", "qty": 30 }, { "id": "c", "qty": 70 }],
          [{ "id": "a", "qty": 60 }, { "id": "c", "qty": 40 }]
        ]
      }
    },
    "trader": {
      "arb": {
        "count": 2,
        "names": ["arb_1", "arb_2"],
        "costs": [0.0, 0.0],
        "risks": [0.0, 0.0],
        "waits": [[0, 3], [0, 3]],
        "batches": [1, 1],
        "wallets": [
          { "a": 16, "b": 16, "c": 16 },
          { "a": 16, "b": 16, "c": 16 }
        ]
      }
    },
    "provider": {
      "wave": {
        "count": 3,
        "names": ["wave_1", "wave_2", "wave_3"],
        "variances": [0.1, 0.1, 0.1],
        "wallets": [
          { "a": 10, "b": 10, "c": 10 },
          { "a": 10, "b": 10, "c": 10 },
          { "a": 10, "b": 10, "c": 10 }
        ],
        "targets": [
          {
            "amm_1": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 0
            },
            "amm_2": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 0
            }
          },
          {
            "amm_3": {
              "withdrawal_wait": [40, 40], "withdrawal_qty": 60,
              "deposit_wait": [40, 40], "deposit_qty": 2, "deposit_peg": 1
            },
            "amm_4": {
              "withdrawal_wait": [10, 10], "withdrawal_qty": 60,
              "deposit_wait": [10, 10], "deposit_qty": 2, "deposit_peg": 1
            }
          },
          {
            "amm_5": {
              "withdrawal_wait": [20, 20], "withdrawal_qty": 60,
              "deposit_wait": [20, 20], "deposit_qty": 2, "deposit_peg": 1
            },
            "amm_6": {
              "withdrawal_wait": [20, 20], "withdrawal_qty": 60,
              "deposit_wait": [20, 20], "deposit_qty": 2, "deposit_peg": 1
            }
          }
        ]
      }
    }
  },
  "tokens": {
    "a": {
      "name": "token_a",
      "order": 0
    },
    "b": {
      "name": "token_b",
      "order": 1
    },
    "c": {
      "name": "token_c",
      "order": 2
    }
  },
  "peg_token": "a",
  "viz": {
    "flag": true,
    "lanes": {
      "amm": 10,
      "trader": 2,
      "provider": 18
    },
    "colors": {
      "dex": "red",
      "arb": "yellow",
      "wave": "orange",
      "a": "blue",
      "b": "green",
      "c": "purple",
      "channel": "grey"
    },
    "rescale": 0.1
  },
  "topology": {
    "x_bounds": [0, 20],
    "y_bounds": [0, 20],
    "z_bounds": [0, 50]
  }
}

analysis.json

{
  "outputs": {
    "tkn_a_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_a_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_b_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_b_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],
    "tkn_c_best_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "best"},
      {"op": "sum"}
    ],
    "tkn_c_worst_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "prices"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "worst"},
      {"op": "sum"}
    ],


    "amm_1_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_1_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_1"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_2_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_2_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_2"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_3_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_3_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_3_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_3_tkn_c_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_3_tkn_c_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_3"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_3_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_3_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_4_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_4_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_4_tkn_b_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_4_tkn_b_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_4_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_4_tkn_c_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_4_tkn_c_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_4"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_4_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_4"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_4_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_4"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_5_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_5"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_5_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_5"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_5_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_5"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_5_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_5"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_5_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_5"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_5_tkn_c_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_5"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_5_tkn_c_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_5"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_5_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_5"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_5_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_5"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "amm_6_total_ls": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_6"
      },
      {"op": "get", "field": "total_ls"},
      {"op": "sum"}
    ],
    "amm_6_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_6"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_6_tkn_a_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_6"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_6_tkn_a_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_6"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_6_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_6"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "amm_6_tkn_c_price": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_6"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "price"},
      {"op": "sum"}
    ],
    "amm_6_tkn_c_fees": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "amm_6"
      },
      {"op": "get", "field": "pair"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "fee_taken"},
      {"op": "sum"}
    ],
    "amm_6_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_6"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "amm_6_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "amm_6"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "arb_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "arb_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "arb_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_2_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "arb_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "arb_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "arb_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "arb_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],


    "wave_1_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_2_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_3_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_4_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_4"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_5_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_5"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_amm_6_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_1"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_6"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_1_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_1_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_1"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "wave_2_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_2_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_3_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_4_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_4"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_5_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_5"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_amm_6_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_2"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_6"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_2_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_2"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_2_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_2"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ],

    "wave_3_tkn_a_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_3"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "a"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_3_tkn_b_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_3"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "b"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_3_tkn_c_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_3"
      },
      {"op": "get", "field": "wallet"},
      {"op": "get", "field": "c"},
      {"op": "get", "field": "qty"},
      {"op": "sum"}
    ],
    "wave_3_amm_1_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_3"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_1"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_3_amm_2_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_3"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_2"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_3_amm_3_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_3"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_3"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_3_amm_4_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_3"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_4"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_3_amm_5_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_3"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_5"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_3_amm_6_ls_qty": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "wave_3"
      },
      {"op": "get", "field": "targets"},
      {"op": "get", "field": "amm_6"},
      {"op": "get", "field": "ls_qty"},
      {"op": "sum"}
    ],
    "wave_3_max_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_3"},
      {"op": "get", "field": "max"},
      {"op": "sum"}
    ],
    "wave_3_min_wealth": [
      {
        "op": "filter",
        "field": "agent_name",
        "comparison": "eq",
        "value": "price_wealth_monitor"
      },
      {"op": "get", "field": "wealth"},
      {"op": "get", "field": "wave_3"},
      {"op": "get", "field": "min"},
      {"op": "sum"}
    ]


  },

  "plots": [
    {
      "title": "Market Prices",
      "type": "timeseries",
      "data": [
        {"y": "tkn_a_best_price", "name": "tkn_a_best"},
        {"y": "tkn_a_worst_price", "name": "tkn_a_worst"},
        {"y": "tkn_b_best_price", "name": "tkn_b_best"},
        {"y": "tkn_b_worst_price", "name": "tkn_b_worst"},
        {"y": "tkn_c_best_price", "name": "tkn_c_best"},
        {"y": "tkn_c_worst_price", "name": "tkn_c_worst"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "AMM Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_qty", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_qty", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_qty", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_qty", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_b_qty", "name": "amm_3_tkn_b"},
        {"y": "amm_3_tkn_c_qty", "name": "amm_3_tkn_c"},
        {"y": "amm_4_tkn_b_qty", "name": "amm_4_tkn_b"},
        {"y": "amm_4_tkn_c_qty", "name": "amm_4_tkn_c"},
        {"y": "amm_5_tkn_a_qty", "name": "amm_5_tkn_a"},
        {"y": "amm_5_tkn_c_qty", "name": "amm_5_tkn_c"},
        {"y": "amm_6_tkn_a_qty", "name": "amm_6_tkn_a"},
        {"y": "amm_6_tkn_c_qty", "name": "amm_6_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Prices",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_price", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_price", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_price", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_price", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_b_price", "name": "amm_3_tkn_b"},
        {"y": "amm_3_tkn_c_price", "name": "amm_3_tkn_c"},
        {"y": "amm_4_tkn_b_price", "name": "amm_4_tkn_b"},
        {"y": "amm_4_tkn_c_price", "name": "amm_4_tkn_c"},
        {"y": "amm_5_tkn_a_price", "name": "amm_5_tkn_a"},
        {"y": "amm_5_tkn_c_price", "name": "amm_5_tkn_c"},
        {"y": "amm_6_tkn_a_price", "name": "amm_6_tkn_a"},
        {"y": "amm_6_tkn_c_price", "name": "amm_6_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Wealth",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_max_wealth", "name": "amm_1_max"},
        {"y": "amm_1_min_wealth", "name": "amm_1_min"},
        {"y": "amm_2_max_wealth", "name": "amm_2_max"},
        {"y": "amm_2_min_wealth", "name": "amm_2_min"},
        {"y": "amm_3_max_wealth", "name": "amm_3_max"},
        {"y": "amm_3_min_wealth", "name": "amm_3_min"},
        {"y": "amm_4_max_wealth", "name": "amm_4_max"},
        {"y": "amm_4_min_wealth", "name": "amm_4_min"},
        {"y": "amm_5_max_wealth", "name": "amm_5_max"},
        {"y": "amm_5_min_wealth", "name": "amm_5_min"},
        {"y": "amm_6_max_wealth", "name": "amm_6_max"},
        {"y": "amm_6_min_wealth", "name": "amm_6_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Token Fees",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_tkn_a_fees", "name": "amm_1_tkn_a"},
        {"y": "amm_1_tkn_b_fees", "name": "amm_1_tkn_b"},
        {"y": "amm_2_tkn_a_fees", "name": "amm_2_tkn_a"},
        {"y": "amm_2_tkn_b_fees", "name": "amm_2_tkn_b"},
        {"y": "amm_3_tkn_b_fees", "name": "amm_3_tkn_b"},
        {"y": "amm_3_tkn_c_fees", "name": "amm_3_tkn_c"},
        {"y": "amm_4_tkn_b_fees", "name": "amm_4_tkn_b"},
        {"y": "amm_4_tkn_c_fees", "name": "amm_4_tkn_c"},
        {"y": "amm_5_tkn_a_fees", "name": "amm_5_tkn_a"},
        {"y": "amm_5_tkn_c_fees", "name": "amm_5_tkn_c"},
        {"y": "amm_6_tkn_a_fees", "name": "amm_6_tkn_a"},
        {"y": "amm_6_tkn_c_fees", "name": "amm_6_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "AMM Total Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "amm_1_total_ls", "name": "amm_1_ls"},
        {"y": "amm_2_total_ls", "name": "amm_2_ls"},
        {"y": "amm_3_total_ls", "name": "amm_3_ls"},
        {"y": "amm_4_total_ls", "name": "amm_4_ls"},
        {"y": "amm_5_total_ls", "name": "amm_5_ls"},
        {"y": "amm_6_total_ls", "name": "amm_6_ls"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Trader Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_tkn_a_qty", "name": "arb_1_tkn_a"},
        {"y": "arb_1_tkn_b_qty", "name": "arb_1_tkn_b"},
        {"y": "arb_1_tkn_c_qty", "name": "arb_1_tkn_c"},
        {"y": "arb_2_tkn_a_qty", "name": "arb_2_tkn_a"},
        {"y": "arb_2_tkn_b_qty", "name": "arb_2_tkn_b"},
        {"y": "arb_2_tkn_c_qty", "name": "arb_2_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Trader Wealth",
      "type": "timeseries",
      "data": [
        {"y": "arb_1_max_wealth", "name": "arb_1_max"},
        {"y": "arb_1_min_wealth", "name": "arb_1_min"},
        {"y": "arb_2_max_wealth", "name": "arb_2_max"},
        {"y": "arb_2_min_wealth", "name": "arb_2_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },


    {
      "title": "Provider Token Quantities",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_tkn_a_qty", "name": "wave_1_tkn_a"},
        {"y": "wave_1_tkn_b_qty", "name": "wave_1_tkn_b"},
        {"y": "wave_1_tkn_c_qty", "name": "wave_1_tkn_c"},
        {"y": "wave_2_tkn_a_qty", "name": "wave_2_tkn_a"},
        {"y": "wave_2_tkn_b_qty", "name": "wave_2_tkn_b"},
        {"y": "wave_2_tkn_c_qty", "name": "wave_2_tkn_c"},
        {"y": "wave_3_tkn_a_qty", "name": "wave_3_tkn_a"},
        {"y": "wave_3_tkn_b_qty", "name": "wave_3_tkn_b"},
        {"y": "wave_3_tkn_c_qty", "name": "wave_3_tkn_c"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
        {
      "title": "Provider Liquidity Shares",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_amm_1_ls_qty", "name": "wave_1_amm_1"},
        {"y": "wave_1_amm_2_ls_qty", "name": "wave_1_amm_2"},
        {"y": "wave_2_amm_3_ls_qty", "name": "wave_2_amm_3"},
        {"y": "wave_2_amm_4_ls_qty", "name": "wave_2_amm_4"},
        {"y": "wave_3_amm_5_ls_qty", "name": "wave_3_amm_5"},
        {"y": "wave_3_amm_6_ls_qty", "name": "wave_3_amm_6"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    },
    {
      "title": "Provider Wealth",
      "type": "timeseries",
      "data": [
        {"y": "wave_1_max_wealth", "name": "wave_1_max"},
        {"y": "wave_1_min_wealth", "name": "wave_1_min"},
        {"y": "wave_2_max_wealth", "name": "wave_2_max"},
        {"y": "wave_2_min_wealth", "name": "wave_2_min"},
        {"y": "wave_3_max_wealth", "name": "wave_3_max"},
        {"y": "wave_3_min_wealth", "name": "wave_3_min"}
      ],
      "layout": {
        "height": "50%",
        "width": "100%",
        "hideLegend": false,
        "hideCollatedLegend": true
      },
      "position": {"x": "0%", "y": "0%"}
    }

  ]
}

What Does this Simulation Lack?

Although this simulation proves a great tool for learning tool for markets, trading and DEX. There are certain limiting factors that prevent the model from being as realistic as possible. These issues are:

  • Discrete time loop
  • Sequential execution
  • Limited scale
  • Lack of error resolution
  • Disconnect from the real environment