Skip to content

Instantly share code, notes, and snippets.

@chatziko
Last active October 3, 2022 12:54
Show Gist options
  • Save chatziko/e5a67b55c9d75e4bad1979db582411fe to your computer and use it in GitHub Desktop.
Save chatziko/e5a67b55c9d75e4bad1979db582411fe to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{"cells":[{"cell_type":"markdown","source":[" # Notes on manipulating arithmetic and geometric mean TWAPs\n"," am-TWAPs and gm-TWAPs with $m$ samples are defined as follows:\n","\n"," $$\n"," t_a = \\frac{x_1 + \\ldots + x_m}{m}\n"," \\qquad\n"," t_g = \\sqrt[m]{x_1 \\ldots x_m}\n"," $$\n","\n"," In the following we assume that the current constant price is 1, and that we can change it to $\\delta$\n"," for $n$ out of the $m$ samples (eg $\\delta = 1.5$ is a 50% increase, while $\\delta = 0.5$ is 50% decrease).\n"," The TWAPs in this case become:\n","\n","\n"," $$\n"," t_a = 1 + \\frac{n}{m}(\\delta - 1)\n"," \\qquad\n"," t_g = \\delta^\\frac{n}{m}\n"," $$\n","\n"," As an example, take $m=600$ and $\\delta = 100$, the behaviour of the TWAPs as a function\n"," of the number of manimulated samples is given below:"],"metadata":{}},{"cell_type":"code","execution_count":1,"source":["import matplotlib.pyplot as plt\n","import numpy as np\n","import math\n","\n","\n","m = 600\t\t# TWAP samples\n","delta = 100;\n","\n","def twap_geom(n):\n","\treturn delta ** (n / m)\n","\n","def twap_arith(n):\n","\treturn (m + n * (delta - 1)) / m\n","\n","\n","x = np.linspace(0, m, m+1);\n","plt.plot(x, np.vectorize(twap_geom)(x), label='gm-TWAP')\n","plt.plot(x, np.vectorize(twap_arith)(x), label='am-TWAP')\n","plt.legend()\n","plt.xlabel('$n$')\n","plt.ylabel('TWAP')\n","plt.show()"],"outputs":[{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAYUAA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sul1TgKLAQ2APkaq0t9qdUzluxLvbH84Bo5yY+q/HAvwGb/X407rkeABr4WSmVopQabV/mjp+vBCAb+My+W+9jpVQoTlgXbywKHkcbfxq4zdhipVQYMA14UGt9svJj7rQuWmur1joR4y/tLkBLkyNdMKXU1cBRrXWK2VmqSS+tdSeM3Sn3KqUuq/ygG32+/IBOwPta645AIX/sKgIcty7eWBQ8ZdrPI0qpWAD79VH7cpdeP6WUP0ZB+FprPd2+2C3X5RStdS6wBGM3S6RS6tQ8JZXzVqyL/fEI4LiTo55JT2CoUmo/MBVjF9IE3G89ANBaH7RfHwV+xCjW7vj5ygQytdZr7Pd/wCgSDl8XbywKnjLt50xgpP32SIz986eW32EfjdANyKu0uWkqpZQCPgG2a63fqvSQO65LjFIq0n47GOPYyHaM4nCD/Wmnr8updbwBWGz/S89UWuvHtdZxWut4jP8Li7XWt+Jm6wGglApVSoWfug1cCaThhp8vrfVhIEMp1cK+qB+wDWesi9kHVEw6iDME+B1jH/CTZuc5j7xTgCygHOMviFEY+3EXAbuAX4Ao+3MVxuiqPcAWINns/JXWoxfG5u5mINV+GeKm69Ie2GhflzTgGfvyxsBaYDfwPRBoXx5kv7/b/nhjs9fhDOvUB5jtruthz7zJftl66v+2O36+7PkSgfX2z9hPQE1nrIu0uRBCCFHBG3cfCSGEOAspCkIIISpIURBCCFFBioIQQogKUhSEEEJUkKIghBCighQFIYQQFaQoCFHNlFLTlVIvKaWWKaXSlVL9zc4kxPmSoiBE9WuH0WX0Mox5Cm41OY8Q502KghDVSCkVgtEk7m37In8g17xEQlwYKQpCVK/WQIrW2mq/3x6jN5IQbkGKghDVqx1Go79T2mM0NBPCLUhREKJ6nV4U2iJbCsKNSJdUIYQQFWRLQQghRAUpCkIIISpIURBCCFFBioIQQogKUhSEEEJUkKIghBCighQFIYQQFf4fDfFGT061kOgAAAAASUVORK5CYII=","text/plain":["<Figure size 432x288 with 1 Axes>"]},"metadata":{"needs_background":"light"}}],"metadata":{}},{"cell_type":"markdown","source":[" We can see that the gm-TWAP is converging more slowly to the requested change. One needs\n"," to manipulate more samples to increase the price by the same amount.\n","\n"," However, when we __decrease__ the price, we have the opposite effect. Using $\\delta = 0.01$ we get:"],"metadata":{}},{"cell_type":"code","execution_count":2,"source":["delta = 0.01\n","plt.plot(x, np.vectorize(twap_geom)(x), label='gm-TWAP')\n","plt.plot(x, np.vectorize(twap_arith)(x), label='am-TWAP')\n","plt.legend()\n","plt.ylabel('TWAP')\n","plt.show()"],"outputs":[{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAYIAAAD4CAYAAADhNOGaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd3hVVdbH8e9Kr6RTQui9Bwg1dJQmRURGsDEOiArYRp3BsTuWmdF3REYsCOIgCoqNIoKAUqQHCL2HFnoNhCSk7fePc2EihlCSm5Obuz7Pkyf3ntt+B2NWztn7rC3GGJRSSrkvD7sDKKWUspcWAqWUcnNaCJRSys1pIVBKKTenhUAppdycl90BblRkZKSpWrWq3TGUUsqlrF279qQxJiq/x1yuEFStWpWEhAS7YyillEsRkf1Xe0xPDSmllJvTQqCUUm5OC4FSSrk5lxsjUEqVTllZWSQnJ5ORkWF3FJfm5+dHTEwM3t7e1/0aLQRKqRIhOTmZ4OBgqlatiojYHcclGWM4deoUycnJVKtW7bpf57RTQyLyiYgcF5HNV3lcRGSsiOwWkY0i0sxZWZRSJV9GRgYRERFaBApBRIiIiLjhoypnjhF8CvQo4PGeQC3H13DgAydmUUq5AC0ChXcz/4ZOKwTGmCXA6QKe0g+YbCwrgVARqeCsPFs3JbD84ycgS88/KqVUXnbOGqoIHMxzP9mx7XdEZLiIJIhIwokTJ27qw9I3zaLtoUlcHBcPB1bd1HsopVRB5s2bR2xsLL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Sl2KNB/qKyD5gGtbpoXdxvf0AwBhzyPH9OPAdVoF2xZ+vZCDZGLPKcf9rrMLg9H1xl0JwPctmuoK8S3sOwTrffmn7/Y5ZBK2BlDyHkrYSEcFaiW6bMebfeR5yxX2JEpFQx21/rLGObVgF4U7H067clxK3FKsx5lljTIwxpirW/ws/G2PuwcX2A0BEAkUk+NJtoBuwGRf8+TLGHAUOikgdx6auwFaKY1/sHiApxoGYXsBOrHO6z9md5zryTgWOAFlYfykMxTovuxDYBSwAwh3PFaxZUXuATUCc3fnz7Ec7rEPZjUCi46uXi+5LY2C9Y182Ay86tlcHVgO7gemAr2O7n+P+bsfj1e3eh3z2qRMw21X3w5F5g+Nry6X/t13x58uRLxZIcPyMfQ+EFce+aIsJpZRyc+5yakgppdRVaCFQSik3p4VAKaXcnBYCpZRyc1oIlFLKzWkhUEopN6eFQCml3Nz/AwVlM9Q2owHdAAAAAElFTkSuQmCC","text/plain":["<Figure size 432x288 with 1 Axes>"]},"metadata":{"needs_background":"light"}}],"metadata":{}},{"cell_type":"markdown","source":[" In this case, gm-TWAP performs worse, the price decreases faster.\n"," (In both cases $t_g$ is below $t_a$, but now we want the price to go down.)\n"," ### Achieving a given goal\n"," Now assume we want to achieve a $\\Delta$ change in the price, and we want to compute\n"," the number of samples $n_a$ (resp. $n_g$) required to reach $t_a = \\Delta$ (resp. $t_g = \\Delta$).\n"," We find\n"," $$\n"," n_a = m \\frac{\\Delta - 1}{\\delta-1}\n"," \\qquad\n"," n_g = m \\frac{\\ln\\Delta}{\\ln\\delta}\n"," $$\n","\n"," Setting our goal $\\Delta = 1.05$ (5% increase), we find that, as expected, gm-TWAP\n"," is safer, as it requires a higher number of manipulated samples:"],"metadata":{}},{"cell_type":"code","execution_count":3,"source":["Delta = 1.05\n","\n","def steps_arith(delta):\n","\treturn m * (Delta - 1) / (delta - 1)\n","\n","def steps_geom(delta):\n","\treturn m * math.log(Delta) / math.log(delta)\n","\n","x = np.linspace(10, 1000, 1000)\n","xt = [10, 100, 1000]\n","plt.xticks(xt, xt)\n","plt.plot(x, np.vectorize(steps_geom)(x), label='gm-TWAP')\n","plt.plot(x, np.vectorize(steps_arith)(x), label='am-TWAP')\n","plt.legend()\n","plt.xlabel('$\\delta$')\n","plt.ylabel('$n$')\n","plt.show()"],"outputs":[{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAX4AAAEICAYAAABYoZ8gAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3deXRc5Z3m8e9Ptai0y1q8L5KNbYzxLhNj4+AQQsjC6qHbzElCEzgeujtnOpx09zgTAp3u0JMzyXRDTpbGTYDQJCahIQkECG0gEMCAkUFgsA3eMBbeZNnW6pJU0jt/3JIsy5YtW1Jdqe7zOadO3a3q/VkcnvfWe2+9Zc45REQkODL8LkBERFJLwS8iEjAKfhGRgFHwi4gEjIJfRCRgwn4X0BclJSWurKzM7zJERIaVDRs2HHTOlfbcPiyCv6ysjMrKSr/LEBEZVsxs18m2a6hHRCRgFPwiIgGj4BcRCZhhMcYvIumpra2N6upq4vG436UMa7FYjPHjxxOJRPp0vIJfRHxTXV1NXl4eZWVlmJnf5QxLzjlqa2uprq6mvLy8T6/RUI+I+CYej1NcXKzQ7wczo7i4+Iw+NSn4RcRXCv3+O9O/YVoH/3Ob9/OTF7b5XYaIyJCS1sH/pw9quOfFHX6XISJp7JlnnmHu3LnMnTuX3Nxcpk+fzty5c/nKV77CvHnzqKqqAiCRSJCbm8tDDz3U9doFCxbw5ptvAlBVVYWZ8Yc//OG49w+FQsydO5fzzz+f6667jubm5n7XnNbBH4uGONra7ncZIpLGPvvZz1JVVUVVVRUVFRX84he/oKqqigcffJAlS5awbt06AN5++22mTZvWtd7U1MT27duZM2cOAGvWrOGiiy5izZo1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CS9DXimpP0Yv4iIHC8IZ/wiItKNgl9EJGDSKvjN7D4zO2Bm73bbVmRma81sa/J5RKraMM8PzWybmb1jZvP707aIDH8DlSFmdkPy+K1mdsOZ1JBWwQ88AFzeY9sq4Dnn3FTgueR6qtr4HDA1+VgJ/LSfbYvI8PcA/cwQMysC7sD72doLgDvO5KQ2rYLfOfcn4FCPzVcBP08u/xy4OoVtXAU86DyvAYVmNqY/7YvI8DZAGfJZYK1z7pBz7jCwlhM7k16lVfD3YpRzbm9yeR8wKoVtnOyH5ccNQvsiMrydaYb0K1uCEPxdnOv+E/bDtw0RSV+pyJAgBP/+zuGV5POBFLahH5YXkb440wzpV7YEIfgfBzqveN8A/C6FbTwOfCV5ZX4RUNft45yISKczzZBngMvMbETyou5lyW19klbf3DWzNcAyvGlM9+Nd9f4t8GtgIt7Uzn/mnOt5YWVQ2jAzA36Ed9GlGbjROVd5tm2LyPA3UBliZl8F/nfybe90zt3f5xrSKfhFROT0gjDUIyIi3Sj4RUQCRsEvIhIwCn4RkYBR8IuIBIyCX0QkYBT8IiIBo+AXOUtmVmBmvzGzDWa20cxu9rsmkb4I+12AyDC2HGhwzi0AMLMsn+sR6ROd8YucvTeBi82s0sy+A7T4XZBIXyj4Rc6CmRUA/xeYDSwCPoX3oxkiQ56GekTOzv8AnnHO1QGY2avAaH9LEukbnfGLnJ15wHs91jf6VIvIGVHwi5ydw3hhj5l9AcgH1vlakUgfaVpmkbNgZuXAr4BMYCfwV865Pf5WJdI3Cn4RkYDRUI+ISMAo+EVEAkbBLyISMAp+EZGAUfCLiASMgl9EJGAU/CIiAfP/AdDNITPdHCFeAAAAAElFTkSuQmCC","text/plain":["<Figure size 432x288 with 1 Axes>"]},"metadata":{"needs_background":"light"}}],"metadata":{}},{"cell_type":"markdown","source":[" On the other hand, if the goal is $\\Delta = 0.95$ (5% __decrease__), then we have the opposite\n"," behaviour, gm-TWAP is now __less__ safe.\n"," This suggests that it might be easier to perform attacks that are based on decreasing a price."],"metadata":{}},{"cell_type":"code","execution_count":4,"source":["Delta = 0.95\n","\n","x = np.linspace(0.001, 0.01, 1000)\n","xt = [0.001, 0.005, 0.01]\n","plt.xticks(xt, xt)\n","# plt.ylim(bottom=0, top=40)\n","plt.plot(x, np.vectorize(steps_geom)(x), label='gm-TWAP')\n","plt.plot(x, np.vectorize(steps_arith)(x), label='am-TWAP')\n","plt.legend()\n","plt.xlabel('$\\delta$')\n","plt.ylabel('$n$')\n","plt.show()"],"outputs":[{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAX4AAAEICAYAAABYoZ8gAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAalElEQVR4nO3df3BV5b3v8fc3+0d2fhlIQA1iSuRQLiIaJCgQbKmtVj1TkXK8B8+ZlunYob2nzpxyeztDj7ZqW2c6t+2pdk6nFqf+Gi30cNSrttoe6tVaRcVgY0XQiyIcoggUJSQkO9k7ee4fe2WThMTs/FjZhOfzmlmz13rWs9Z61mbxYfHstZ9tzjlERMQfBflugIiIjC8Fv4iIZxT8IiKeUfCLiHhGwS8i4plovhuQiylTprgZM2bkuxkiIhPKtm3b/uqcm9q/fEIE/4wZM2hoaMh3M0REJhQz2ztQubp6REQ8o+AXEfGMgl9ExDMKfhERzyj4RUQ8o+AXEfGMgl9ExDOhPcdvZgngWaAwOM5/OOduNrMaYCNQCWwDvuCc6wyrHSJyEnIumLozE73mXXffdc4Nsb5nezfE+v7rPqpONziGWN9vP0O2kSHWD9QuBxesgsqZY/r2h/kFrg7gUudcq5nFgOfM7EngfwI/cc5tNLM7geuBn4fYDhlLvf/CjvmFPsZ/EfMSKEOdw1CBl0ud4Z7DWP45DHCOI3kfJEcGZ188cYLfZX7hpTVYjAWTAy4F/iEovw+4hbCCf89zcOD1sQ+UMQ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bgeX96iwH7gvm/wP4tGV+YHc5sNE51+Gcewd4K9gfzrlngQ/G4wQkNKFcGyIhGfH16pw75px7DkiO9OATLfjPAvb1Wm4Kygas45xLA81AZY7bysQV1rXhgP80s21mtiaEdoufRnO9jtq4/9i6yASz1Dn3rpmdDmw2szeC/yGKTFgT7Y7/XeDsXsvTg7IB65hZFCgHDue4rUxcoVwbzrme14PAI6gLSMbGaK7XUZtowf8yMMvMaswsTuYDj8f61XkMWB3M/x3wf13mE5HHgFXBJ+U1wCxg6zi1W8I35teGmZWYWRmAmZUAlwN68kvGwmiu19HL96fbI/g0/Crg/5H5RPzGoOy7wNXBfALYROYDuq3AOb22vTHY7k3gyl7lG4D9QIpMX9v1+T5PTfm/Nsg8cfFqML3es09NmsZiGuX1uofMAymtQWadO5xja8gGERHPTLSuHhERGSUFv4iIZxT8IiKeUfCLiHhGwS8i4hkFv4iIZxT8IiKeUfCLjJCZlZvZI8EAbq+Z2Zfz3SaRXGiQNpGRWwm0OOcWAJhZUZ7bI5IT3fGLjNwrwCfNrMHMbgU68t0gkVwo+EVGwMzKgf8NnA8sAj7FiT+kIXJSUlePyMh8Bfi9c64ZwMxeAM7Mb5NEcqM7fpGRmU9mxM7ey6/lqS0iw6LgFxmZD8mEPWb2t8BpwJa8tkgkRxqWWWQEgh9s+TVQCLwD/JNz7r38tkokNwp+ERHPqKtHRMQzCn4REc8o+EVEPKPgFxHxjIJfRMQzCn4REc8o+EVEPPP/Afimk6Jxdp+lAAAAAElFTkSuQmCC","text/plain":["<Figure size 432x288 with 1 Axes>"]},"metadata":{"needs_background":"light"}}],"metadata":{}}],"nbformat":4,"nbformat_minor":2,"metadata":{"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":3},"orig_nbformat":4}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment