更新文档,添加和修改多个API接口的描述,确保文档内容的准确性和完整性,提升开发者使用体验。

This commit is contained in:
discountry
2025-09-27 02:10:28 +08:00
parent 2c62d2ed3e
commit 64640f4494
297 changed files with 33451 additions and 5 deletions
+128 -5
View File
@@ -4,10 +4,11 @@
"": {
"name": "ritmex-bot",
"dependencies": {
"@grvt/sdk": "^0.0.1-beta.17",
"axios": "^1.12.2",
"ccxt": "^4.5.5",
"dotenv": "^17.2.2",
"ink": "^6.3.1",
"ink-table": "^3.1.0",
"react": "^19.1.1",
"ws": "^8.18.3",
},
@@ -21,6 +22,8 @@
},
},
"packages": {
"@adraffy/ens-normalize": ["@adraffy/ens-normalize@1.10.1", "", {}, "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw=="],
"@alcalzone/ansi-tokenize": ["@alcalzone/ansi-tokenize@0.2.0", "", { "dependencies": { "ansi-styles": "^6.2.1", "is-fullwidth-code-point": "^5.0.0" } }, "sha512-qI/5TaaaCZE4yeSZ83lu0+xi1r88JSxUjnH4OP/iZF7+KKZ75u3ee5isd0LxX+6N8U0npL61YrpbthILHB6BnA=="],
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.10", "", { "os": "aix", "cpu": "ppc64" }, "sha512-0NFWnA+7l41irNuaSVlLfgNT12caWJVLzp5eAVhZ0z1qpxbockccEt3s+149rE64VUI3Ml2zt8Nv5JVc4QXTsw=="],
@@ -75,8 +78,32 @@
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.10", "", { "os": "win32", "cpu": "x64" }, "sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw=="],
"@ethereumjs/common": ["@ethereumjs/common@3.2.0", "", { "dependencies": { "@ethereumjs/util": "^8.1.0", "crc-32": "^1.2.0" } }, "sha512-pksvzI0VyLgmuEF2FA/JR/4/y6hcPq8OUail3/AvycBaW1d5VSauOZzqGvJ3RTmR4MU35lWE8KseKOsEhrFRBA=="],
"@ethereumjs/rlp": ["@ethereumjs/rlp@4.0.1", "", { "bin": { "rlp": "bin/rlp" } }, "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw=="],
"@ethereumjs/tx": ["@ethereumjs/tx@4.2.0", "", { "dependencies": { "@ethereumjs/common": "^3.2.0", "@ethereumjs/rlp": "^4.0.1", "@ethereumjs/util": "^8.1.0", "ethereum-cryptography": "^2.0.0" } }, "sha512-1nc6VO4jtFd172BbSnTnDQVr9IYBFl1y4xPzZdtkrkKIncBCkdbgfdRV+MiTkJYAtTxvV12GRZLqBFT1PNK6Yw=="],
"@ethereumjs/util": ["@ethereumjs/util@8.1.0", "", { "dependencies": { "@ethereumjs/rlp": "^4.0.1", "ethereum-cryptography": "^2.0.0", "micro-ftch": "^0.3.1" } }, "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA=="],
"@grvt/client": ["@grvt/client@1.6.4", "", { "dependencies": { "axios": "^1.12.2" } }, "sha512-yZfEvsC/BtkcdMjoB7Eh6gshBraz/9810qCllvNXDx6OmdxR+NfxPO+ucNlPbyjEt1HfSVzHBWB1yGnVl1usNA=="],
"@grvt/sdk": ["@grvt/sdk@0.0.1-beta.17", "", { "dependencies": { "@grvt/client": "^1.4.21", "@metamask/eth-sig-util": "^8.2.0", "@types/ws": "^8.18.1", "ethers": "^6.13.5", "set-cookie-parser": "^2.7.1", "ws": "^8.18.1" } }, "sha512-ADWGg7mM79xOu354DaYNZY3hyAEGEFC076vEK1dXFL6ykITyluKOPj2eetP3mkLeyLUyYvA7ct1pz6JmLC77Hw=="],
"@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
"@metamask/abi-utils": ["@metamask/abi-utils@3.0.0", "", { "dependencies": { "@metamask/superstruct": "^3.1.0", "@metamask/utils": "^11.0.1" } }, "sha512-a/l0DiSIr7+CBYVpHygUa3ztSlYLFCQMsklLna+t6qmNY9+eIO5TedNxhyIyvaJ+4cN7TLy0NQFbp9FV3X2ktg=="],
"@metamask/eth-sig-util": ["@metamask/eth-sig-util@8.2.0", "", { "dependencies": { "@ethereumjs/rlp": "^4.0.1", "@ethereumjs/util": "^8.1.0", "@metamask/abi-utils": "^3.0.0", "@metamask/utils": "^11.0.1", "@scure/base": "~1.1.3", "ethereum-cryptography": "^2.1.2", "tweetnacl": "^1.0.3" } }, "sha512-LZDglIh4gYGw9Myp+2aIwKrj6lIJpMC4e0m7wKJU+BxLLBFcrTgKrjdjstXGVWvuYG3kutlh9J+uNBRPJqffWQ=="],
"@metamask/superstruct": ["@metamask/superstruct@3.2.1", "", {}, "sha512-fLgJnDOXFmuVlB38rUN5SmU7hAFQcCjrg3Vrxz67KTY7YHFnSNEKvX4avmEBdOI0yTCxZjwMCFEqsC8k2+Wd3g=="],
"@metamask/utils": ["@metamask/utils@11.8.1", "", { "dependencies": { "@ethereumjs/tx": "^4.2.0", "@metamask/superstruct": "^3.1.0", "@noble/hashes": "^1.3.1", "@scure/base": "^1.1.3", "@types/debug": "^4.1.7", "@types/lodash": "^4.17.20", "debug": "^4.3.4", "lodash": "^4.17.21", "pony-cause": "^2.1.10", "semver": "^7.5.4", "uuid": "^9.0.1" } }, "sha512-DIbsNUyqWLFgqJlZxi1OOCMYvI23GqFCvNJAtzv8/WXWzJfnJnvp1M24j7VvUe3URBi3S86UgQ7+7aWU9p/cnQ=="],
"@noble/curves": ["@noble/curves@1.2.0", "", { "dependencies": { "@noble/hashes": "1.3.2" } }, "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw=="],
"@noble/hashes": ["@noble/hashes@1.3.2", "", {}, "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ=="],
"@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.52.0", "", { "os": "android", "cpu": "arm" }, "sha512-VxDYCDqOaR7NXzAtvRx7G1u54d2kEHopb28YH/pKzY6y0qmogP3gG7CSiWsq9WvDFxOQMpNEyjVAHZFXfH3o/A=="],
"@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.52.0", "", { "os": "android", "cpu": "arm64" }, "sha512-pqDirm8koABIKvzL59YI9W9DWbRlTX7RWhN+auR8HXJxo89m4mjqbah7nJZjeKNTNYopqL+yGg+0mhCpf3xZtQ=="],
@@ -121,18 +148,32 @@
"@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.52.0", "", { "os": "win32", "cpu": "x64" }, "sha512-6iKDCVSIUQ8jPMoIV0OytRKniaYyy5EbY/RRydmLW8ZR3cEBhxbWl5ro0rkUNe0ef6sScvhbY79HrjRm8i3vDQ=="],
"@scure/base": ["@scure/base@1.1.9", "", {}, "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg=="],
"@scure/bip32": ["@scure/bip32@1.4.0", "", { "dependencies": { "@noble/curves": "~1.4.0", "@noble/hashes": "~1.4.0", "@scure/base": "~1.1.6" } }, "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg=="],
"@scure/bip39": ["@scure/bip39@1.3.0", "", { "dependencies": { "@noble/hashes": "~1.4.0", "@scure/base": "~1.1.6" } }, "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ=="],
"@types/bun": ["@types/bun@1.2.22", "", { "dependencies": { "bun-types": "1.2.22" } }, "sha512-5A/KrKos2ZcN0c6ljRSOa1fYIyCKhZfIVYeuyb4snnvomnpFqC0tTsEkdqNxbAgExV384OETQ//WAjl3XbYqQA=="],
"@types/chai": ["@types/chai@5.2.2", "", { "dependencies": { "@types/deep-eql": "*" } }, "sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg=="],
"@types/debug": ["@types/debug@4.1.12", "", { "dependencies": { "@types/ms": "*" } }, "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ=="],
"@types/deep-eql": ["@types/deep-eql@4.0.2", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="],
"@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
"@types/lodash": ["@types/lodash@4.17.20", "", {}, "sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA=="],
"@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="],
"@types/node": ["@types/node@24.5.2", "", { "dependencies": { "undici-types": "~7.12.0" } }, "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ=="],
"@types/react": ["@types/react@19.1.13", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-hHkbU/eoO3EG5/MZkuFSKmYqPbSVk5byPFa3e7y/8TybHiLMACgI8seVYlicwk7H5K/rI2px9xrQp/C+AUDTiQ=="],
"@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="],
"@vitest/expect": ["@vitest/expect@3.2.4", "", { "dependencies": { "@types/chai": "^5.2.2", "@vitest/spy": "3.2.4", "@vitest/utils": "3.2.4", "chai": "^5.2.0", "tinyrainbow": "^2.0.0" } }, "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig=="],
"@vitest/mocker": ["@vitest/mocker@3.2.4", "", { "dependencies": { "@vitest/spy": "3.2.4", "estree-walker": "^3.0.3", "magic-string": "^0.30.17" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" }, "optionalPeers": ["msw", "vite"] }, "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ=="],
@@ -147,6 +188,8 @@
"@vitest/utils": ["@vitest/utils@3.2.4", "", { "dependencies": { "@vitest/pretty-format": "3.2.4", "loupe": "^3.1.4", "tinyrainbow": "^2.0.0" } }, "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA=="],
"aes-js": ["aes-js@4.0.0-beta.5", "", {}, "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q=="],
"ansi-escapes": ["ansi-escapes@7.1.0", "", { "dependencies": { "environment": "^1.0.0" } }, "sha512-YdhtCd19sKRKfAAUsrcC1wzm4JuzJoiX4pOJqIoW2qmKj5WzG/dL8uUJ0361zaXtHqK7gEhOwtAtz7t3Yq3X5g=="],
"ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="],
@@ -155,12 +198,18 @@
"assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="],
"asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="],
"auto-bind": ["auto-bind@5.0.1", "", {}, "sha512-ooviqdwwgfIfNmDwo94wlshcdzfO64XV0Cg6oDsDYBJfITDz1EngD2z7DkbvCWn+XIMsIqW27sEVF6qcpJrRcg=="],
"axios": ["axios@1.12.2", "", { "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw=="],
"bun-types": ["bun-types@1.2.22", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-hwaAu8tct/Zn6Zft4U9BsZcXkYomzpHJX28ofvx7k0Zz2HNz54n1n+tDgxoWFGB4PcFvJXJQloPhaV2eP3Q6EA=="],
"cac": ["cac@6.7.14", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="],
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
"ccxt": ["ccxt@4.5.5", "", { "dependencies": { "ws": "^8.8.1" } }, "sha512-AyhwTFLkx4sO985ImIOfumEBox7AHD/iqk5tPGICObUSZG6wTXg0aRzU8Hjz974aCMG4msFwLk3A/iXPKAU4wA=="],
"chai": ["chai@5.3.3", "", { "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", "deep-eql": "^5.0.1", "loupe": "^3.1.0", "pathval": "^2.0.0" } }, "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw=="],
@@ -177,22 +226,38 @@
"code-excerpt": ["code-excerpt@4.0.0", "", { "dependencies": { "convert-to-spaces": "^2.0.1" } }, "sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA=="],
"combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="],
"convert-to-spaces": ["convert-to-spaces@2.0.1", "", {}, "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ=="],
"crc-32": ["crc-32@1.2.2", "", { "bin": { "crc32": "bin/crc32.njs" } }, "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="],
"csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
"deep-eql": ["deep-eql@5.0.2", "", {}, "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q=="],
"delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="],
"dotenv": ["dotenv@17.2.2", "", {}, "sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q=="],
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
"emoji-regex": ["emoji-regex@10.5.0", "", {}, "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg=="],
"environment": ["environment@1.1.0", "", {}, "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q=="],
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
"es-module-lexer": ["es-module-lexer@1.7.0", "", {}, "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA=="],
"es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
"es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="],
"es-toolkit": ["es-toolkit@1.39.10", "", {}, "sha512-E0iGnTtbDhkeczB0T+mxmoVlT4YNweEKBLq7oaU4p11mecdsZpNWOglI4895Vh4usbQ+LsJiuLuI2L0Vdmfm2w=="],
"esbuild": ["esbuild@0.25.10", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.10", "@esbuild/android-arm": "0.25.10", "@esbuild/android-arm64": "0.25.10", "@esbuild/android-x64": "0.25.10", "@esbuild/darwin-arm64": "0.25.10", "@esbuild/darwin-x64": "0.25.10", "@esbuild/freebsd-arm64": "0.25.10", "@esbuild/freebsd-x64": "0.25.10", "@esbuild/linux-arm": "0.25.10", "@esbuild/linux-arm64": "0.25.10", "@esbuild/linux-ia32": "0.25.10", "@esbuild/linux-loong64": "0.25.10", "@esbuild/linux-mips64el": "0.25.10", "@esbuild/linux-ppc64": "0.25.10", "@esbuild/linux-riscv64": "0.25.10", "@esbuild/linux-s390x": "0.25.10", "@esbuild/linux-x64": "0.25.10", "@esbuild/netbsd-arm64": "0.25.10", "@esbuild/netbsd-x64": "0.25.10", "@esbuild/openbsd-arm64": "0.25.10", "@esbuild/openbsd-x64": "0.25.10", "@esbuild/openharmony-arm64": "0.25.10", "@esbuild/sunos-x64": "0.25.10", "@esbuild/win32-arm64": "0.25.10", "@esbuild/win32-ia32": "0.25.10", "@esbuild/win32-x64": "0.25.10" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ=="],
@@ -201,38 +266,66 @@
"estree-walker": ["estree-walker@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="],
"ethereum-cryptography": ["ethereum-cryptography@2.2.1", "", { "dependencies": { "@noble/curves": "1.4.2", "@noble/hashes": "1.4.0", "@scure/bip32": "1.4.0", "@scure/bip39": "1.3.0" } }, "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg=="],
"ethers": ["ethers@6.15.0", "", { "dependencies": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", "@noble/hashes": "1.3.2", "@types/node": "22.7.5", "aes-js": "4.0.0-beta.5", "tslib": "2.7.0", "ws": "8.17.1" } }, "sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ=="],
"expect-type": ["expect-type@1.2.2", "", {}, "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA=="],
"fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
"follow-redirects": ["follow-redirects@1.15.11", "", {}, "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ=="],
"form-data": ["form-data@4.0.4", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.2", "mime-types": "^2.1.12" } }, "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow=="],
"fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
"get-east-asian-width": ["get-east-asian-width@1.4.0", "", {}, "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q=="],
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
"has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="],
"hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
"indent-string": ["indent-string@5.0.0", "", {}, "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg=="],
"ink": ["ink@6.3.1", "", { "dependencies": { "@alcalzone/ansi-tokenize": "^0.2.0", "ansi-escapes": "^7.0.0", "ansi-styles": "^6.2.1", "auto-bind": "^5.0.1", "chalk": "^5.6.0", "cli-boxes": "^3.0.0", "cli-cursor": "^4.0.0", "cli-truncate": "^4.0.0", "code-excerpt": "^4.0.0", "es-toolkit": "^1.39.10", "indent-string": "^5.0.0", "is-in-ci": "^2.0.0", "patch-console": "^2.0.0", "react-reconciler": "^0.32.0", "signal-exit": "^3.0.7", "slice-ansi": "^7.1.0", "stack-utils": "^2.0.6", "string-width": "^7.2.0", "type-fest": "^4.27.0", "widest-line": "^5.0.0", "wrap-ansi": "^9.0.0", "ws": "^8.18.0", "yoga-layout": "~3.2.1" }, "peerDependencies": { "@types/react": ">=19.0.0", "react": ">=19.0.0", "react-devtools-core": "^6.1.2" }, "optionalPeers": ["@types/react", "react-devtools-core"] }, "sha512-3wGwITGrzL6rkWsi2gEKzgwdafGn4ZYd3u4oRp+sOPvfoxEHlnoB5Vnk9Uy5dMRUhDOqF3hqr4rLQ4lEzBc2sQ=="],
"ink-table": ["ink-table@3.1.0", "", { "dependencies": { "object-hash": "^2.0.3" }, "peerDependencies": { "ink": ">=3.0.0", "react": ">=16.8.0" } }, "sha512-qxVb4DIaEaJryvF9uZGydnmP9Hkmas3DCKVpEcBYC0E4eJd3qNgNe+PZKuzgCERFe9LfAS1TNWxCr9+AU4v3YA=="],
"is-fullwidth-code-point": ["is-fullwidth-code-point@5.1.0", "", { "dependencies": { "get-east-asian-width": "^1.3.1" } }, "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ=="],
"is-in-ci": ["is-in-ci@2.0.0", "", { "bin": { "is-in-ci": "cli.js" } }, "sha512-cFeerHriAnhrQSbpAxL37W1wcJKUUX07HyLWZCW1URJT/ra3GyUTzBgUnh24TMVfNTV2Hij2HLxkPHFZfOZy5w=="],
"js-tokens": ["js-tokens@9.0.1", "", {}, "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ=="],
"lodash": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="],
"loupe": ["loupe@3.2.1", "", {}, "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ=="],
"magic-string": ["magic-string@0.30.19", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw=="],
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
"micro-ftch": ["micro-ftch@0.3.1", "", {}, "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg=="],
"mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
"mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
"mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="],
"ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
"nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
"object-hash": ["object-hash@2.2.0", "", {}, "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw=="],
"onetime": ["onetime@5.1.2", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="],
"patch-console": ["patch-console@2.0.0", "", {}, "sha512-0YNdUceMdaQwoKce1gatDScmMo5pu/tfABfnzEqeG0gtTmd7mh/WcwgUjtAeOU7N8nFFlbQBnFK2gXW5fGvmMA=="],
@@ -245,8 +338,12 @@
"picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
"pony-cause": ["pony-cause@2.1.11", "", {}, "sha512-M7LhCsdNbNgiLYiP4WjsfLUuFmCfnjdF6jKe2R9NKl4WFN+HZPGHJZ9lnLP7f9ZnKe3U9nuWD0szirmj+migUg=="],
"postcss": ["postcss@8.5.6", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg=="],
"proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="],
"react": ["react@19.1.1", "", {}, "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ=="],
"react-reconciler": ["react-reconciler@0.32.0", "", { "dependencies": { "scheduler": "^0.26.0" }, "peerDependencies": { "react": "^19.1.0" } }, "sha512-2NPMOzgTlG0ZWdIf3qG+dcbLSoAc/uLfOwckc3ofy5sSK0pLJqnQLpUFxvGcN2rlXSjnVtGeeFLNimCQEj5gOQ=="],
@@ -257,6 +354,10 @@
"scheduler": ["scheduler@0.26.0", "", {}, "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA=="],
"semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="],
"set-cookie-parser": ["set-cookie-parser@2.7.1", "", {}, "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ=="],
"siginfo": ["siginfo@2.0.0", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="],
"signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
@@ -289,12 +390,18 @@
"tinyspy": ["tinyspy@4.0.4", "", {}, "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q=="],
"tslib": ["tslib@2.7.0", "", {}, "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA=="],
"tweetnacl": ["tweetnacl@1.0.3", "", {}, "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="],
"type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="],
"typescript": ["typescript@5.9.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="],
"undici-types": ["undici-types@7.12.0", "", {}, "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ=="],
"uuid": ["uuid@9.0.1", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA=="],
"vite": ["vite@7.1.7", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-VbA8ScMvAISJNJVbRDTJdCwqQoAareR/wutevKanhR2/1EkoXVZVkkORaYm/tNVCjP/UDTKtcw3bAkwOUdedmA=="],
"vite-node": ["vite-node@3.2.4", "", { "dependencies": { "cac": "^6.7.14", "debug": "^4.4.1", "es-module-lexer": "^1.7.0", "pathe": "^2.0.3", "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" }, "bin": { "vite-node": "vite-node.mjs" } }, "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg=="],
@@ -311,8 +418,24 @@
"yoga-layout": ["yoga-layout@3.2.1", "", {}, "sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ=="],
"@scure/bip32/@noble/curves": ["@noble/curves@1.4.2", "", { "dependencies": { "@noble/hashes": "1.4.0" } }, "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw=="],
"@scure/bip32/@noble/hashes": ["@noble/hashes@1.4.0", "", {}, "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg=="],
"@scure/bip39/@noble/hashes": ["@noble/hashes@1.4.0", "", {}, "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg=="],
"cli-truncate/slice-ansi": ["slice-ansi@5.0.0", "", { "dependencies": { "ansi-styles": "^6.0.0", "is-fullwidth-code-point": "^4.0.0" } }, "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ=="],
"ethereum-cryptography/@noble/curves": ["@noble/curves@1.4.2", "", { "dependencies": { "@noble/hashes": "1.4.0" } }, "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw=="],
"ethereum-cryptography/@noble/hashes": ["@noble/hashes@1.4.0", "", {}, "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg=="],
"ethers/@types/node": ["@types/node@22.7.5", "", { "dependencies": { "undici-types": "~6.19.2" } }, "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ=="],
"ethers/ws": ["ws@8.17.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ=="],
"cli-truncate/slice-ansi/is-fullwidth-code-point": ["is-fullwidth-code-point@4.0.0", "", {}, "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ=="],
"ethers/@types/node/undici-types": ["undici-types@6.19.8", "", {}, "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="],
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
!!! info "[Ack](/../../schemas/ack)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|ack<br>`a` |boolean|True|Gravity has acknowledged that the request has been successfully received and it will process it in the backend|
+10
View File
@@ -0,0 +1,10 @@
!!! info "[AckResponse](/../../schemas/ack_response)"
Used to acknowledge a request has been received and will be processed<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |Ack|True|The Ack Object|
??? info "[Ack](/../../schemas/ack)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|ack<br>`a` |boolean|True|Gravity has acknowledged that the request has been successfully received and it will process it in the backend|
@@ -0,0 +1,21 @@
!!! info "[AggregatedAccountSummary](/../../schemas/aggregated_account_summary)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|main_account_id<br>`ma` |string|True|The main account ID of the account to which the summary belongs|
|total_equity<br>`te` |string|True|Total equity of the main (+ sub) account, denominated in USD|
|spot_balances<br>`sb` |[SpotBalance]|True|The list of spot assets owned by this main (+ sub) account, and their balances|
|vault_investments<br>`vi` |[VaultInvestment]|True|The list of vault investments held by this main account|
??? info "[SpotBalance](/../../schemas/spot_balance)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|currency<br>`c` |string|True|The currency you hold a spot balance in|
|balance<br>`b` |string|True|This currency's balance in this trading account.|
|index_price<br>`ip` |string|True|The index price of this currency. (reported in `USD`)|
??? info "[VaultInvestment](/../../schemas/vault_investment)"
Summarizes a vault investment held by a funding account<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|vault_id<br>`vi` |string|True|The trading account ID of the vault invested in.|
|num_lp_tokens<br>`nl` |string|True|The number of shares held by the investor.|
|share_price<br>`sp` |string|True|The current share price (in USD) of this vault investment.|
@@ -0,0 +1,27 @@
!!! info "[ApiAggregatedAccountSummaryResponse](/../../schemas/api_aggregated_account_summary_response)"
The aggregated account summary, that reports the total equity and spot balances of a funding (main) account, and its constituent trading (sub) accounts<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |AggregatedAccountSummary|True|The aggregated account summary|
??? info "[AggregatedAccountSummary](/../../schemas/aggregated_account_summary)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|main_account_id<br>`ma` |string|True|The main account ID of the account to which the summary belongs|
|total_equity<br>`te` |string|True|Total equity of the main (+ sub) account, denominated in USD|
|spot_balances<br>`sb` |[SpotBalance]|True|The list of spot assets owned by this main (+ sub) account, and their balances|
|vault_investments<br>`vi` |[VaultInvestment]|True|The list of vault investments held by this main account|
??? info "[SpotBalance](/../../schemas/spot_balance)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|currency<br>`c` |string|True|The currency you hold a spot balance in|
|balance<br>`b` |string|True|This currency's balance in this trading account.|
|index_price<br>`ip` |string|True|The index price of this currency. (reported in `USD`)|
??? info "[VaultInvestment](/../../schemas/vault_investment)"
Summarizes a vault investment held by a funding account<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|vault_id<br>`vi` |string|True|The trading account ID of the vault invested in.|
|num_lp_tokens<br>`nl` |string|True|The number of shares held by the investor.|
|share_price<br>`sp` |string|True|The current share price (in USD) of this vault investment.|
@@ -0,0 +1,18 @@
!!! info "[ApiCancelAllOrdersRequest](/../../schemas/api_cancel_all_orders_request)"
Cancel all orders on the orderbook for this trading account. This may not match new orders in flight.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The subaccount ID cancelling all orders|
|kind<br>`k` |[Kind]|False<br>`all`|The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be cancelled|
|base<br>`b` |[string]|False<br>`all`|The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be cancelled|
|quote<br>`q` |[string]|False<br>`all`|The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be cancelled|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
@@ -0,0 +1,4 @@
!!! info "[ApiCancelAllOrdersResponse](/../../schemas/api_cancel_all_orders_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |integer|True|The number of orders cancelled|
@@ -0,0 +1,7 @@
!!! info "[ApiCancelOnDisconnectRequest](/../../schemas/api_cancel_on_disconnect_request)"
Auto-Cancel All Open Orders when the countdown time hits zero.<br><br>Market Maker inputs a countdown time parameter in milliseconds (e.g. 120000 for 120s) rounded down to the smallest second follows the following logic:<br> - Market Maker initially entered a value between 0 -> 1000, which is rounded to 0: will result in termination of their COD<br> - Market Maker initially entered a value between 1001 -> 300_000, which is rounded to the nearest second: will result in refresh of their COD<br> - Market Maker initially entered a value bigger than 300_000, which will result in error (upper bound)<br>Market Maker will send a heartbeat message by calling the endpoint at specific intervals (ex. every 30 seconds) to the server to refresh the count down.<br><br>If the server does not receive a heartbeat message within the countdown time, it will cancel all open orders for the specified Sub Account ID.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The subaccount ID cancelling the orders for|
|countdown_time<br>`ct` |string|False<br>`1000`|Countdown time in milliseconds (ex. 120000 for 120s).<br><br>0 to disable the timer.<br><br>Does not accept negative values.<br><br>Minimum acceptable value is 1,000.<br><br>Maximum acceptable value is 300,000|
@@ -0,0 +1,9 @@
!!! info "[ApiCancelOrderRequest](/../../schemas/api_cancel_order_request)"
Cancel an order on the orderbook for this trading account. Either `order_id` or `client_order_id` must be provided.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The subaccount ID cancelling the order|
|order_id<br>`oi` |string|False<br>`0`|Cancel the order with this `order_id`|
|client_order_id<br>`co` |string|False<br>`0`|Cancel the order with this `client_order_id`|
|time_to_live_ms<br>`tt` |string|False<br>`100`|Specifies the time-to-live (in milliseconds) for this cancellation.<br>During this period, any order creation with a matching `client_order_id` will be cancelled and not be added to the GRVT matching engine.<br>This mechanism helps mitigate time-of-flight issues where cancellations might arrive before the corresponding orders.<br>Hence, cancellation by `order_id` ignores this field as the exchange can only assign `order_id`s to already-processed order creations.<br>The duration cannot be negative, is rounded down to the nearest 100ms (e.g., `'670'` -> `'600'`, `'30'` -> `'0'`) and capped at 5 seconds (i.e., `'5000'`).<br>Value of `'0'` or omission results in the default time-to-live value being applied.<br>If the caller requests multiple successive cancellations for a given order, such that the time-to-live windows overlap, only the first request will be considered.<br>|
@@ -0,0 +1,147 @@
!!! info "[ApiCancelOrderResponse](/../../schemas/api_cancel_order_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |Order|True|The cancelled order|
??? info "[Order](/../../schemas/order)"
Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.<br>GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.<br>This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.<br>Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.<br><br>All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.<br>This minimizes the amount of trust users have to offer to GRVT<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order_id<br>`oi` |string|False<br>`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend|
|sub_account_id<br>`sa` |string|True|The subaccount initiating the order|
|is_market<br>`im` |boolean|False<br>`false`|If the order is a market order<br>Market Orders do not have a limit price, and are always executed according to the maker order price.<br>Market Orders must always be taker orders|
|time_in_force<br>`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:<ul><br><li>PARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg</li><br><li>FULL EXECUTION = AON / FOK - only allows full size execution on all legs</li><br><li>TAKER ONLY = IOC / FOK - only allows taker orders</li><br><li>MAKER OR TAKER = GTT / AON - allows maker or taker orders</li><br></ul>Exchange only supports (GTT, IOC, FOK)<br>RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)|
|post_only<br>`po` |boolean|False<br>`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.<br>If False, Order can be either a maker or taker order. <b>In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.</b><br><br>| | Must Fill All | Can Fill Partial |<br>| - | - | - |<br>| Must Be Taker | FOK + False | IOC + False |<br>| Can Be Either | AON + False | GTC + False |<br>| Must Be Maker | AON + True | GTC + True |<br>|
|reduce_only<br>`ro` |boolean|False<br>`false`|If True, Order must reduce the position size, or be cancelled|
|legs<br>`l` |[OrderLeg]|True|The legs present in this order<br>The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice|
|signature<br>`s` |Signature|True|The signature approving this order|
|metadata<br>`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client|
|state<br>`s1` |OrderState|False<br>`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client|
??? info "[TimeInForce](/../../schemas/time_in_force)"
| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Fill Immediately | FOK | IOC |
| Can Fill Till Time | AON | GTC |
<br>
|Value| Description |
|-|-|
|`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired|
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to trade in this leg|
|size<br>`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.|
|limit_price<br>`lp` |string|False<br>`0`|The limit price of the order leg, expressed in `9` decimals.<br>This is the number of quote currency units to pay/receive for this leg.<br>This should be `null/0` if the order is a market order|
|is_buying_asset<br>`ib` |boolean|True|Specifies if the order leg is a buy or sell|
??? info "[Signature](/../../schemas/signature)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|signer<br>`s` |string|True|The address (public key) of the wallet signing the payload|
|r<br>`r` |string|True|Signature R|
|s<br>`s1` |string|True|Signature S|
|v<br>`v` |integer|True|Signature V|
|expiration<br>`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
|nonce<br>`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.<br>ie. You can send the same exact instruction twice with different nonces.<br>When the same nonce is used, the same payload will generate the same signature.<br>Our system will consider the payload a duplicate, and ignore it.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.<br>Hence, fields in here are never signed, and is never transmitted to the smart contract.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|create_time<br>`ct` |string|False<br>`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds|
|trigger<br>`t` |TriggerOrderMetadata|False<br>``|Trigger fields are used to support any type of trigger order such as TP/SL|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)"
Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).<br><br>Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_type<br>`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc|
|tpsl<br>`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>|
??? info "[TriggerType](/../../schemas/trigger_type)"
Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.<br><br>Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.|
|`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.|
|`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.|
??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)"
Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>### Fields:<br>- **triggerBy**: Defines the price type that activates the order (e.g., index price).<br>- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_by<br>`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price<br>`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.<br><br>Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|no trigger condition|
|`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price|
|`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
@@ -0,0 +1,40 @@
!!! info "[ApiCandlestickRequest](/../../schemas/api_candlestick_request)"
Kline/Candlestick bars for an instrument. Klines are uniquely identified by their instrument, type, interval, and open time.<br><br>Pagination works as follows:<ul><li>We perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.</li><li>The lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.</li><li>If a `cursor` is provided, it will be used to fetch results from that point onwards.</li><li>Pagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.</li></ul><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
|interval<br>`i1` |CandlestickInterval|True|The interval of each candlestick|
|type<br>`t` |CandlestickType|True|The type of candlestick data to retrieve|
|start_time<br>`st` |string|False<br>`0`|Start time of kline data in unix nanoseconds|
|end_time<br>`et` |string|False<br>`now()`|End time of kline data in unix nanoseconds|
|limit<br>`l` |integer|False<br>`500`|The limit to query for. Defaults to 500; Max 1000|
|cursor<br>`c` |string|False<br>`''`|The cursor to indicate when to start the query from|
??? info "[CandlestickInterval](/../../schemas/candlestick_interval)"
|Value| Description |
|-|-|
|`CI_1_M` = 1|1 minute|
|`CI_3_M` = 2|3 minutes|
|`CI_5_M` = 3|5 minutes|
|`CI_15_M` = 4|15 minutes|
|`CI_30_M` = 5|30 minutes|
|`CI_1_H` = 6|1 hour|
|`CI_2_H` = 7|2 hour|
|`CI_4_H` = 8|4 hour|
|`CI_6_H` = 9|6 hour|
|`CI_8_H` = 10|8 hour|
|`CI_12_H` = 11|12 hour|
|`CI_1_D` = 12|1 day|
|`CI_3_D` = 13|3 days|
|`CI_5_D` = 14|5 days|
|`CI_1_W` = 15|1 week|
|`CI_2_W` = 16|2 weeks|
|`CI_3_W` = 17|3 weeks|
|`CI_4_W` = 18|4 weeks|
??? info "[CandlestickType](/../../schemas/candlestick_type)"
|Value| Description |
|-|-|
|`TRADE` = 1|Tracks traded prices|
|`MARK` = 2|Tracks mark prices|
|`INDEX` = 3|Tracks index prices|
|`MID` = 4|Tracks book mid prices|
@@ -0,0 +1,20 @@
!!! info "[ApiCandlestickResponse](/../../schemas/api_candlestick_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[Candlestick]|True|The candlestick result set for given interval|
|next<br>`n` |string|False<br>`''`|The cursor to indicate when to start the next query from|
??? info "[Candlestick](/../../schemas/candlestick)"
<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|open_time<br>`ot` |string|True|Open time of kline bar in unix nanoseconds|
|close_time<br>`ct` |string|True|Close time of kline bar in unix nanosecond|
|open<br>`o` |string|True|The open price, expressed in underlying currency resolution units|
|close<br>`c` |string|True|The close price, expressed in underlying currency resolution units|
|high<br>`h` |string|True|The high price, expressed in underlying currency resolution units|
|low<br>`l` |string|True|The low price, expressed in underlying currency resolution units|
|volume_b<br>`vb` |string|True|The underlying volume transacted, expressed in base asset decimal units|
|volume_q<br>`vq` |string|True|The quote volume transacted, expressed in quote asset decimal units|
|trades<br>`t` |integer|True|The number of trades transacted|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
@@ -0,0 +1,5 @@
!!! info "[ApiCategoryAffinityScoreRequest](/../../schemas/api_category_affinity_score_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|start_time<br>`st` |string|True|The start time of query. Can leave empty to query from the beginning|
|end_time<br>`et` |string|True|The end time of query. Can leave empty to query until now|
@@ -0,0 +1,12 @@
!!! info "[ApiCategoryAffinityScoreResponse](/../../schemas/api_category_affinity_score_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[UserCategoryAffinityScore]|True|The list of categoryAffinities score|
??? info "[UserCategoryAffinityScore](/../../schemas/user_category_affinity_score)"
<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_id<br>`ai` |string|True|The off chain account id|
|category_id<br>`ci` |string|True|target category|
|affinity_score<br>`as` |number|True|affinity score|
@@ -0,0 +1,149 @@
!!! info "[ApiCreateBulkOrdersRequest](/../../schemas/api_create_bulk_orders_request)"
Create multiple orders simultaneously for this trading account.<br><br>This endpoint supports the following order scenarios:<br>- One-Cancels-Other (OCO) orders combining TP/SL<br>- One-Sends-Other (OSO) orders<br><br>Usage:<br>- For OCO (TP/SL pair): Send exactly 2 orders in the same request - one Take Profit and one Stop Loss order<br>- For OSO: Send exactly one main order and one contingent order (TP and/or SL)<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|orders<br>`o` |[Order]|True|The orders to create|
??? info "[Order](/../../schemas/order)"
Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.<br>GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.<br>This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.<br>Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.<br><br>All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.<br>This minimizes the amount of trust users have to offer to GRVT<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order_id<br>`oi` |string|False<br>`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend|
|sub_account_id<br>`sa` |string|True|The subaccount initiating the order|
|is_market<br>`im` |boolean|False<br>`false`|If the order is a market order<br>Market Orders do not have a limit price, and are always executed according to the maker order price.<br>Market Orders must always be taker orders|
|time_in_force<br>`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:<ul><br><li>PARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg</li><br><li>FULL EXECUTION = AON / FOK - only allows full size execution on all legs</li><br><li>TAKER ONLY = IOC / FOK - only allows taker orders</li><br><li>MAKER OR TAKER = GTT / AON - allows maker or taker orders</li><br></ul>Exchange only supports (GTT, IOC, FOK)<br>RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)|
|post_only<br>`po` |boolean|False<br>`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.<br>If False, Order can be either a maker or taker order. <b>In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.</b><br><br>| | Must Fill All | Can Fill Partial |<br>| - | - | - |<br>| Must Be Taker | FOK + False | IOC + False |<br>| Can Be Either | AON + False | GTC + False |<br>| Must Be Maker | AON + True | GTC + True |<br>|
|reduce_only<br>`ro` |boolean|False<br>`false`|If True, Order must reduce the position size, or be cancelled|
|legs<br>`l` |[OrderLeg]|True|The legs present in this order<br>The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice|
|signature<br>`s` |Signature|True|The signature approving this order|
|metadata<br>`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client|
|state<br>`s1` |OrderState|False<br>`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client|
??? info "[TimeInForce](/../../schemas/time_in_force)"
| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Fill Immediately | FOK | IOC |
| Can Fill Till Time | AON | GTC |
<br>
|Value| Description |
|-|-|
|`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired|
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to trade in this leg|
|size<br>`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.|
|limit_price<br>`lp` |string|False<br>`0`|The limit price of the order leg, expressed in `9` decimals.<br>This is the number of quote currency units to pay/receive for this leg.<br>This should be `null/0` if the order is a market order|
|is_buying_asset<br>`ib` |boolean|True|Specifies if the order leg is a buy or sell|
??? info "[Signature](/../../schemas/signature)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|signer<br>`s` |string|True|The address (public key) of the wallet signing the payload|
|r<br>`r` |string|True|Signature R|
|s<br>`s1` |string|True|Signature S|
|v<br>`v` |integer|True|Signature V|
|expiration<br>`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
|nonce<br>`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.<br>ie. You can send the same exact instruction twice with different nonces.<br>When the same nonce is used, the same payload will generate the same signature.<br>Our system will consider the payload a duplicate, and ignore it.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.<br>Hence, fields in here are never signed, and is never transmitted to the smart contract.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|create_time<br>`ct` |string|False<br>`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds|
|trigger<br>`t` |TriggerOrderMetadata|False<br>``|Trigger fields are used to support any type of trigger order such as TP/SL|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)"
Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).<br><br>Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_type<br>`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc|
|tpsl<br>`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>|
??? info "[TriggerType](/../../schemas/trigger_type)"
Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.<br><br>Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.|
|`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.|
|`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.|
??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)"
Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>### Fields:<br>- **triggerBy**: Defines the price type that activates the order (e.g., index price).<br>- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_by<br>`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price<br>`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.<br><br>Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|no trigger condition|
|`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price|
|`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
@@ -0,0 +1,147 @@
!!! info "[ApiCreateBulkOrdersResponse](/../../schemas/api_create_bulk_orders_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[Order]|True|The created orders in same order as requested|
??? info "[Order](/../../schemas/order)"
Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.<br>GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.<br>This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.<br>Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.<br><br>All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.<br>This minimizes the amount of trust users have to offer to GRVT<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order_id<br>`oi` |string|False<br>`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend|
|sub_account_id<br>`sa` |string|True|The subaccount initiating the order|
|is_market<br>`im` |boolean|False<br>`false`|If the order is a market order<br>Market Orders do not have a limit price, and are always executed according to the maker order price.<br>Market Orders must always be taker orders|
|time_in_force<br>`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:<ul><br><li>PARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg</li><br><li>FULL EXECUTION = AON / FOK - only allows full size execution on all legs</li><br><li>TAKER ONLY = IOC / FOK - only allows taker orders</li><br><li>MAKER OR TAKER = GTT / AON - allows maker or taker orders</li><br></ul>Exchange only supports (GTT, IOC, FOK)<br>RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)|
|post_only<br>`po` |boolean|False<br>`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.<br>If False, Order can be either a maker or taker order. <b>In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.</b><br><br>| | Must Fill All | Can Fill Partial |<br>| - | - | - |<br>| Must Be Taker | FOK + False | IOC + False |<br>| Can Be Either | AON + False | GTC + False |<br>| Must Be Maker | AON + True | GTC + True |<br>|
|reduce_only<br>`ro` |boolean|False<br>`false`|If True, Order must reduce the position size, or be cancelled|
|legs<br>`l` |[OrderLeg]|True|The legs present in this order<br>The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice|
|signature<br>`s` |Signature|True|The signature approving this order|
|metadata<br>`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client|
|state<br>`s1` |OrderState|False<br>`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client|
??? info "[TimeInForce](/../../schemas/time_in_force)"
| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Fill Immediately | FOK | IOC |
| Can Fill Till Time | AON | GTC |
<br>
|Value| Description |
|-|-|
|`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired|
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to trade in this leg|
|size<br>`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.|
|limit_price<br>`lp` |string|False<br>`0`|The limit price of the order leg, expressed in `9` decimals.<br>This is the number of quote currency units to pay/receive for this leg.<br>This should be `null/0` if the order is a market order|
|is_buying_asset<br>`ib` |boolean|True|Specifies if the order leg is a buy or sell|
??? info "[Signature](/../../schemas/signature)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|signer<br>`s` |string|True|The address (public key) of the wallet signing the payload|
|r<br>`r` |string|True|Signature R|
|s<br>`s1` |string|True|Signature S|
|v<br>`v` |integer|True|Signature V|
|expiration<br>`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
|nonce<br>`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.<br>ie. You can send the same exact instruction twice with different nonces.<br>When the same nonce is used, the same payload will generate the same signature.<br>Our system will consider the payload a duplicate, and ignore it.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.<br>Hence, fields in here are never signed, and is never transmitted to the smart contract.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|create_time<br>`ct` |string|False<br>`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds|
|trigger<br>`t` |TriggerOrderMetadata|False<br>``|Trigger fields are used to support any type of trigger order such as TP/SL|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)"
Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).<br><br>Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_type<br>`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc|
|tpsl<br>`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>|
??? info "[TriggerType](/../../schemas/trigger_type)"
Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.<br><br>Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.|
|`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.|
|`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.|
??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)"
Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>### Fields:<br>- **triggerBy**: Defines the price type that activates the order (e.g., index price).<br>- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_by<br>`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price<br>`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.<br><br>Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|no trigger condition|
|`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price|
|`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
@@ -0,0 +1,160 @@
!!! info "[ApiCreateOrderRequest](/../../schemas/api_create_order_request)"
Create an order on the orderbook for this trading account.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order<br>`o` |Order|True|The order to create|
??? info "[Order](/../../schemas/order)"
Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.<br>GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.<br>This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.<br>Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.<br><br>All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.<br>This minimizes the amount of trust users have to offer to GRVT<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order_id<br>`oi` |string|False<br>`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend|
|sub_account_id<br>`sa` |string|True|The subaccount initiating the order|
|is_market<br>`im` |boolean|False<br>`false`|If the order is a market order<br>Market Orders do not have a limit price, and are always executed according to the maker order price.<br>Market Orders must always be taker orders|
|time_in_force<br>`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:<ul><br><li>PARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg</li><br><li>FULL EXECUTION = AON / FOK - only allows full size execution on all legs</li><br><li>TAKER ONLY = IOC / FOK - only allows taker orders</li><br><li>MAKER OR TAKER = GTT / AON - allows maker or taker orders</li><br></ul>Exchange only supports (GTT, IOC, FOK)<br>RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)|
|post_only<br>`po` |boolean|False<br>`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.<br>If False, Order can be either a maker or taker order. <b>In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.</b><br><br>| | Must Fill All | Can Fill Partial |<br>| - | - | - |<br>| Must Be Taker | FOK + False | IOC + False |<br>| Can Be Either | AON + False | GTC + False |<br>| Must Be Maker | AON + True | GTC + True |<br>|
|reduce_only<br>`ro` |boolean|False<br>`false`|If True, Order must reduce the position size, or be cancelled|
|legs<br>`l` |[OrderLeg]|True|The legs present in this order<br>The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice|
|signature<br>`s` |Signature|True|The signature approving this order|
|metadata<br>`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client|
|state<br>`s1` |OrderState|False<br>`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client|
??? info "[TimeInForce](/../../schemas/time_in_force)"
| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Fill Immediately | FOK | IOC |
| Can Fill Till Time | AON | GTC |
<br>
|Value| Description |
|-|-|
|`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired|
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
|`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to trade in this leg|
|size<br>`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.|
|limit_price<br>`lp` |string|False<br>`0`|The limit price of the order leg, expressed in `9` decimals.<br>This is the number of quote currency units to pay/receive for this leg.<br>This should be `null/0` if the order is a market order|
|is_buying_asset<br>`ib` |boolean|True|Specifies if the order leg is a buy or sell|
??? info "[Signature](/../../schemas/signature)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|signer<br>`s` |string|True|The address (public key) of the wallet signing the payload|
|r<br>`r` |string|True|Signature R|
|s<br>`s1` |string|True|Signature S|
|v<br>`v` |integer|True|Signature V|
|expiration<br>`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
|nonce<br>`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.<br>ie. You can send the same exact instruction twice with different nonces.<br>When the same nonce is used, the same payload will generate the same signature.<br>Our system will consider the payload a duplicate, and ignore it.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.<br>Hence, fields in here are never signed, and is never transmitted to the smart contract.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|create_time<br>`ct` |string|False<br>`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds|
|trigger<br>`t` |TriggerOrderMetadata|False<br>``|Trigger fields are used to support any type of trigger order such as TP/SL|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)"
Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).<br><br>Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_type<br>`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc|
|tpsl<br>`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>|
??? info "[TriggerType](/../../schemas/trigger_type)"
Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.<br><br>Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.|
|`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.|
|`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.|
??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)"
Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>### Fields:<br>- **triggerBy**: Defines the price type that activates the order (e.g., index price).<br>- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_by<br>`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price<br>`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
|close_position<br>`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.<br><br>Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|no trigger condition|
|`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price|
|`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price|
|`MID` = 3|MID - Order is activated when the mid price reaches the trigger price|
|`MARK` = 4|MARK - Order is activated when the mark price reaches the trigger price|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
|`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
|`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
|`DERISK_MUST_BE_IOC` = 33|the derisk order must be an IOC order|
|`DERISK_MUST_BE_REDUCE_ONLY` = 34|the derisk order must be a reduce-only order|
|`DERISK_NOT_SUPPORTED` = 35|derisk is not supported|
|`INVALID_ORDER_TYPE` = 36|the order type is invalid|
|`CURRENCY_NOT_DEFINED` = 37|the currency is not defined|
@@ -0,0 +1,158 @@
!!! info "[ApiCreateOrderResponse](/../../schemas/api_create_order_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |Order|True|The created order|
??? info "[Order](/../../schemas/order)"
Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.<br>GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.<br>This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.<br>Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.<br><br>All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.<br>This minimizes the amount of trust users have to offer to GRVT<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order_id<br>`oi` |string|False<br>`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend|
|sub_account_id<br>`sa` |string|True|The subaccount initiating the order|
|is_market<br>`im` |boolean|False<br>`false`|If the order is a market order<br>Market Orders do not have a limit price, and are always executed according to the maker order price.<br>Market Orders must always be taker orders|
|time_in_force<br>`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:<ul><br><li>PARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg</li><br><li>FULL EXECUTION = AON / FOK - only allows full size execution on all legs</li><br><li>TAKER ONLY = IOC / FOK - only allows taker orders</li><br><li>MAKER OR TAKER = GTT / AON - allows maker or taker orders</li><br></ul>Exchange only supports (GTT, IOC, FOK)<br>RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)|
|post_only<br>`po` |boolean|False<br>`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.<br>If False, Order can be either a maker or taker order. <b>In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.</b><br><br>| | Must Fill All | Can Fill Partial |<br>| - | - | - |<br>| Must Be Taker | FOK + False | IOC + False |<br>| Can Be Either | AON + False | GTC + False |<br>| Must Be Maker | AON + True | GTC + True |<br>|
|reduce_only<br>`ro` |boolean|False<br>`false`|If True, Order must reduce the position size, or be cancelled|
|legs<br>`l` |[OrderLeg]|True|The legs present in this order<br>The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice|
|signature<br>`s` |Signature|True|The signature approving this order|
|metadata<br>`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client|
|state<br>`s1` |OrderState|False<br>`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client|
??? info "[TimeInForce](/../../schemas/time_in_force)"
| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Fill Immediately | FOK | IOC |
| Can Fill Till Time | AON | GTC |
<br>
|Value| Description |
|-|-|
|`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired|
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
|`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to trade in this leg|
|size<br>`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.|
|limit_price<br>`lp` |string|False<br>`0`|The limit price of the order leg, expressed in `9` decimals.<br>This is the number of quote currency units to pay/receive for this leg.<br>This should be `null/0` if the order is a market order|
|is_buying_asset<br>`ib` |boolean|True|Specifies if the order leg is a buy or sell|
??? info "[Signature](/../../schemas/signature)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|signer<br>`s` |string|True|The address (public key) of the wallet signing the payload|
|r<br>`r` |string|True|Signature R|
|s<br>`s1` |string|True|Signature S|
|v<br>`v` |integer|True|Signature V|
|expiration<br>`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
|nonce<br>`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.<br>ie. You can send the same exact instruction twice with different nonces.<br>When the same nonce is used, the same payload will generate the same signature.<br>Our system will consider the payload a duplicate, and ignore it.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.<br>Hence, fields in here are never signed, and is never transmitted to the smart contract.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|create_time<br>`ct` |string|False<br>`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds|
|trigger<br>`t` |TriggerOrderMetadata|False<br>``|Trigger fields are used to support any type of trigger order such as TP/SL|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)"
Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).<br><br>Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_type<br>`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc|
|tpsl<br>`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>|
??? info "[TriggerType](/../../schemas/trigger_type)"
Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.<br><br>Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.|
|`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.|
|`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.|
??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)"
Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>### Fields:<br>- **triggerBy**: Defines the price type that activates the order (e.g., index price).<br>- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_by<br>`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price<br>`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
|close_position<br>`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.<br><br>Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|no trigger condition|
|`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price|
|`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price|
|`MID` = 3|MID - Order is activated when the mid price reaches the trigger price|
|`MARK` = 4|MARK - Order is activated when the mark price reaches the trigger price|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
|`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
|`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
|`DERISK_MUST_BE_IOC` = 33|the derisk order must be an IOC order|
|`DERISK_MUST_BE_REDUCE_ONLY` = 34|the derisk order must be a reduce-only order|
|`DERISK_NOT_SUPPORTED` = 35|derisk is not supported|
|`INVALID_ORDER_TYPE` = 36|the order type is invalid|
|`CURRENCY_NOT_DEFINED` = 37|the currency is not defined|
@@ -0,0 +1,11 @@
!!! info "[ApiDepositHistoryRequest](/../../schemas/api_deposit_history_request)"
The request to get the historical deposits of an account<br>The history is returned in reverse chronological order<br><br>Pagination works as follows:<ul><li>We perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.</li><li>The lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.</li><li>If a `cursor` is provided, it will be used to fetch results from that point onwards.</li><li>Pagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.</li></ul><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|currency<br>`c` |[string]|True|The token currency to query for, if nil or empty, return all deposits. Otherwise, only entries matching the filter will be returned|
|start_time<br>`st` |string|False<br>`0`|The start time to query for in unix nanoseconds|
|end_time<br>`et` |string|False<br>`now()`|The end time to query for in unix nanoseconds|
|limit<br>`l` |integer|False<br>`500`|The limit to query for. Defaults to 500; Max 1000|
|cursor<br>`c1` |string|False<br>`''`|The cursor to indicate when to start the next query from|
|main_account_id<br>`ma` |string|False<br>``|Main account ID being queried. By default, applies the requestor's main account ID.|
@@ -0,0 +1,16 @@
!!! info "[ApiDepositHistoryResponse](/../../schemas/api_deposit_history_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[DepositHistory]|True|The deposit history matching the request account|
|next<br>`n` |string|False<br>`''`|The cursor to indicate when to start the next query from|
??? info "[DepositHistory](/../../schemas/deposit_history)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|l_1_hash<br>`l1` |string|True|The L1 txHash of the deposit|
|l_2_hash<br>`l2` |string|True|The L2 txHash of the deposit|
|to_account_id<br>`ta` |string|True|The account to deposit into|
|currency<br>`c` |string|True|The token currency to deposit|
|num_tokens<br>`nt` |string|True|The number of tokens to deposit|
|initiated_time<br>`it` |string|True|The timestamp when the deposit was initiated on L1 in unix nanoseconds|
|confirmed_time<br>`ct` |string|True|The timestamp when the deposit was confirmed on L2 in unix nanoseconds|
|from_address<br>`fa` |string|True|The address of the sender|
+18
View File
@@ -0,0 +1,18 @@
!!! info "[ApiDepositRequest](/../../schemas/api_deposit_request)"
GRVT runs on a ZKSync Hyperchain which settles directly onto Ethereum.<br>To Deposit funds from your L1 wallet into a GRVT SubAccount, you will be required to submit a deposit transaction directly to Ethereum.<br>GRVT's bridge verifier will scan Ethereum from time to time. Once it receives proof that your deposit has been confirmed on Ethereum, it will initiate the deposit process.<br><br>This current payload is used for alpha testing only.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|to_account_id<br>`ta` |string|True|The main account to deposit into|
|currency<br>`c` |Currency|True|The token currency to deposit|
|num_tokens<br>`nt` |string|True|The number of tokens to deposit, quoted in token_currency decimals|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
@@ -0,0 +1,4 @@
!!! info "[ApiDropClientWsRequest](/../../schemas/api_drop_client_ws_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|main_account_id<br>`ma` |string|True||
@@ -0,0 +1,4 @@
!!! info "[ApiDropClientWsResponse](/../../schemas/api_drop_client_ws_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|num_dropped<br>`nd` |integer|True||
@@ -0,0 +1,22 @@
!!! info "[ApiFillHistoryRequest](/../../schemas/api_fill_history_request)"
Query for all historical fills made by a single account. A single order can be matched multiple times, hence there is no real way to uniquely identify a trade.<br><br>Pagination works as follows:<ul><li>We perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.</li><li>The lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.</li><li>If a `cursor` is provided, it will be used to fetch results from that point onwards.</li><li>Pagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.</li></ul><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The sub account ID to request for|
|kind<br>`k` |[Kind]|False<br>`all`|The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned|
|base<br>`b` |[string]|False<br>`all`|The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned|
|quote<br>`q` |[string]|False<br>`all`|The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned|
|start_time<br>`st` |string|False<br>`0`|The start time to apply in unix nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned|
|end_time<br>`et` |string|False<br>`now()`|The end time to apply in unix nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned|
|limit<br>`l` |integer|False<br>`500`|The limit to query for. Defaults to 500; Max 1000|
|cursor<br>`c` |string|False<br>`''`|The cursor to indicate when to start the query from|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
@@ -0,0 +1,45 @@
!!! info "[ApiFillHistoryResponse](/../../schemas/api_fill_history_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[Fill]|True|The private trades matching the request asset|
|next<br>`n` |string|True|The cursor to indicate when to start the query from|
??? info "[Fill](/../../schemas/fill)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|event_time<br>`et` |string|True|Time at which the event was emitted in unix nanoseconds|
|sub_account_id<br>`sa` |string|True|The sub account ID that participated in the trade|
|instrument<br>`i` |string|True|The instrument being represented|
|is_buyer<br>`ib` |boolean|True|The side that the subaccount took on the trade|
|is_taker<br>`it` |boolean|True|The role that the subaccount took on the trade|
|size<br>`s` |string|True|The number of assets being traded, expressed in base asset decimal units|
|price<br>`p` |string|True|The traded price, expressed in `9` decimals|
|mark_price<br>`mp` |string|True|The mark price of the instrument at point of trade, expressed in `9` decimals|
|index_price<br>`ip` |string|True|The index price of the instrument at point of trade, expressed in `9` decimals|
|interest_rate<br>`ir` |string|True|The interest rate of the underlying at point of trade, expressed in centibeeps (1/100th of a basis point)|
|forward_price<br>`fp` |string|True|[Options] The forward price of the option at point of trade, expressed in `9` decimals|
|realized_pnl<br>`rp` |string|True|The realized PnL of the trade, expressed in quote asset decimal units (0 if increasing position size)|
|fee<br>`f` |string|True|The fees paid on the trade, expressed in quote asset decimal unit (negative if maker rebate applied)|
|fee_rate<br>`fr` |string|True|The fee rate paid on the trade|
|trade_id<br>`ti` |string|True|A trade identifier, globally unique, and monotonically increasing (not by `1`).<br>All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.<br>`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`.|
|order_id<br>`oi` |string|True|An order identifier|
|venue<br>`v` |Venue|True|The venue where the trade occurred|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|signer<br>`s1` |string|True|The address (public key) of the wallet signing the payload|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
|is_rpi<br>`ir1` |boolean|True|If the trade is a RPI trade|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`ORDERBOOK` = 1|the trade is cleared on the orderbook venue|
|`RFQ` = 2|the trade is cleared on the RFQ venue|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
@@ -0,0 +1,17 @@
!!! info "[ApiFindEcosystemEpochMetricResponse](/../../schemas/api_find_ecosystem_epoch_metric_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|metric<br>`m` |EcosystemMetric|True|The epoch metric|
|rank<br>`r` |integer|True|The rank of the account in the ecosystem|
|total<br>`t` |integer|True|The total number of accounts in the ecosystem|
|last_calculated_at<br>`lc` |string|True|The time when the ecosystem points were last calculated|
|total_direct_invite_count<br>`td` |integer|True|Direct invite count without relying on epochs|
|total_indirect_invite_count<br>`ti` |integer|True|Indirect invite count without relying on epochs|
??? info "[EcosystemMetric](/../../schemas/ecosystem_metric)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|direct_invite_count<br>`di` |integer|True|Direct invite count|
|indirect_invite_count<br>`ii` |integer|True|Indirect invite count|
|direct_invite_trading_volume<br>`di1` |string|True|Direct invite trading volume|
|indirect_invite_trading_volume<br>`ii1` |string|True|Indirect invite trading volume|
|total_point<br>`tp` |string|True|Total ecosystem point of this epoch/phase|
@@ -0,0 +1,11 @@
!!! info "[ApiFindEcosystemLeaderboardResponse](/../../schemas/api_find_ecosystem_leaderboard_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|users<br>`u` |[EcosystemLeaderboardUser]|True|The list of ecosystem leaderboard users|
??? info "[EcosystemLeaderboardUser](/../../schemas/ecosystem_leaderboard_user)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_id<br>`ai` |string|True|The off chain account id|
|rank<br>`r` |integer|True|The rank of the account in the ecosystem|
|total_point<br>`tp` |string|True|Total ecosystem point|
|twitter_username<br>`tu` |string|True|The twitter username of the account|
@@ -0,0 +1,25 @@
!!! info "[ApiFindFirstEpochMetricResponse](/../../schemas/api_find_first_epoch_metric_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|phase_zero_metric<br>`pz` |EcosystemMetric|True|Phase zero metric|
|phase_one_metric<br>`po` |EcosystemMetric|True|Phase one metric|
|rank<br>`r` |integer|True|The rank of the account in the ecosystem|
|total<br>`t` |integer|True|The total number of accounts in the ecosystem|
|total_point<br>`tp` |string|True|Total ecosystem point of the first epoch|
|last_calculated_at<br>`lc` |string|True|The time when the ecosystem points were last calculated|
??? info "[EcosystemMetric](/../../schemas/ecosystem_metric)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|direct_invite_count<br>`di` |integer|True|Direct invite count|
|indirect_invite_count<br>`ii` |integer|True|Indirect invite count|
|direct_invite_trading_volume<br>`di1` |string|True|Direct invite trading volume|
|indirect_invite_trading_volume<br>`ii1` |string|True|Indirect invite trading volume|
|total_point<br>`tp` |string|True|Total ecosystem point of this epoch/phase|
??? info "[EcosystemMetric](/../../schemas/ecosystem_metric)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|direct_invite_count<br>`di` |integer|True|Direct invite count|
|indirect_invite_count<br>`ii` |integer|True|Indirect invite count|
|direct_invite_trading_volume<br>`di1` |string|True|Direct invite trading volume|
|indirect_invite_trading_volume<br>`ii1` |string|True|Indirect invite trading volume|
|total_point<br>`tp` |string|True|Total ecosystem point of this epoch/phase|
@@ -0,0 +1,12 @@
!!! info "[ApiFindTraderEpochMetricResponse](/../../schemas/api_find_trader_epoch_metric_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|metric<br>`m` |TraderMetric|True|Phase zero metric|
|rank<br>`r` |integer|True|The rank of the account in the trader|
|total<br>`t` |integer|True|The total number of accounts in the trader|
|last_calculated_at<br>`lc` |string|True|The time when the trader points were last calculated|
??? info "[TraderMetric](/../../schemas/trader_metric)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|total_fee<br>`tf` |string|True|Total fee paid|
|total_point<br>`tp` |number|True|Total trader point of this epoch/phase|
@@ -0,0 +1,11 @@
!!! info "[ApiFindTraderLeaderboardResponse](/../../schemas/api_find_trader_leaderboard_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|users<br>`u` |[TraderLeaderboardUser]|True|The list of trader leaderboard users|
??? info "[TraderLeaderboardUser](/../../schemas/trader_leaderboard_user)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_id<br>`ai` |string|True|The off chain account id|
|rank<br>`r` |integer|True|The rank of the account in the Trader|
|total_point<br>`tp` |number|True|Total Trader point|
|twitter_username<br>`tu` |string|True|The twitter username of the account|
@@ -0,0 +1,38 @@
!!! info "[ApiFundingAccountSummaryResponse](/../../schemas/api_funding_account_summary_response)"
The funding account summary, that reports the total equity and spot balances of a funding (main) account<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |FundingAccountSummary|True|The funding account summary|
|tier<br>`t` |ClientTier|True|Client fee tier at the time of query|
??? info "[FundingAccountSummary](/../../schemas/funding_account_summary)"
The funding account summary, that reports the total equity and spot balances of a funding (main) account<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|main_account_id<br>`ma` |string|True|The main account ID of the account to which the summary belongs|
|total_equity<br>`te` |string|True|Total equity of the main account, denominated in USD|
|spot_balances<br>`sb` |[SpotBalance]|True|The list of spot assets owned by this main account, and their balances|
|vault_investments<br>`vi` |[VaultInvestment]|True|The list of vault investments held by this main account|
??? info "[SpotBalance](/../../schemas/spot_balance)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|currency<br>`c` |string|True|The currency you hold a spot balance in|
|balance<br>`b` |string|True|This currency's balance in this trading account.|
|index_price<br>`ip` |string|True|The index price of this currency. (reported in `USD`)|
??? info "[VaultInvestment](/../../schemas/vault_investment)"
Summarizes a vault investment held by a funding account<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|vault_id<br>`vi` |string|True|The trading account ID of the vault invested in.|
|num_lp_tokens<br>`nl` |string|True|The number of shares held by the investor.|
|share_price<br>`sp` |string|True|The current share price (in USD) of this vault investment.|
??? info "[ClientTier](/../../schemas/client_tier)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|tier<br>`t` |integer|True||
|futures_taker_fee<br>`ft` |integer|True||
|futures_maker_fee<br>`fm` |integer|True||
|options_taker_fee<br>`ot` |integer|True||
|options_maker_fee<br>`om` |integer|True||
@@ -0,0 +1,11 @@
!!! info "[ApiFundingPaymentHistoryRequest](/../../schemas/api_funding_payment_history_request)"
Query for all historical funding payments made by a single account.<br><br>Pagination works as follows:<ul><li>We perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.</li><li>The lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.</li><li>If a `cursor` is provided, it will be used to fetch results from that point onwards.</li><li>Pagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.</li></ul><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The sub account ID to request for|
|instrument<br>`i` |string|False<br>`all`|The perpetual instrument to filter for|
|start_time<br>`st` |string|False<br>`0`|The start time to apply in unix nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned|
|end_time<br>`et` |string|False<br>`now()`|The end time to apply in unix nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned|
|limit<br>`l` |integer|False<br>`500`|The limit to query for. Defaults to 500; Max 1000|
|cursor<br>`c` |string|False<br>`''`|The cursor to indicate when to start the query from|
@@ -0,0 +1,14 @@
!!! info "[ApiFundingPaymentHistoryResponse](/../../schemas/api_funding_payment_history_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[FundingPayment]|True|The funding payments matching the request asset|
|next<br>`n` |string|True|The cursor to indicate when to start the query from|
??? info "[FundingPayment](/../../schemas/funding_payment)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|event_time<br>`et` |string|True|Time at which the event was emitted in unix nanoseconds|
|sub_account_id<br>`sa` |string|True|The sub account ID that made the funding payment|
|instrument<br>`i` |string|True|The perpetual instrument being funded|
|currency<br>`c` |string|True|The currency of the funding payment|
|amount<br>`a` |string|True|The amount of the funding payment. Positive if paid, negative if received|
|tx_id<br>`ti` |string|True|The transaction ID of the funding payment.<br>Funding payments can be triggered by a trade, transfer, or liquidation.<br>The `tx_id` will match the corresponding `trade_id` or `tx_id`.|
@@ -0,0 +1,10 @@
!!! info "[ApiFundingRateRequest](/../../schemas/api_funding_rate_request)"
Lookup the historical funding rate of a perpetual future.<br><br>Pagination works as follows:<ul><li>We perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.</li><li>The lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.</li><li>If a `cursor` is provided, it will be used to fetch results from that point onwards.</li><li>Pagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.</li></ul><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
|start_time<br>`st` |string|False<br>`0`|Start time of funding rate in unix nanoseconds|
|end_time<br>`et` |string|False<br>`now()`|End time of funding rate in unix nanoseconds|
|limit<br>`l` |integer|False<br>`500`|The limit to query for. Defaults to 500; Max 1000|
|cursor<br>`c` |string|False<br>`''`|The cursor to indicate when to start the query from|
@@ -0,0 +1,13 @@
!!! info "[ApiFundingRateResponse](/../../schemas/api_funding_rate_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[FundingRate]|True|The funding rate result set for given interval|
|next<br>`n` |string|False<br>`''`|The cursor to indicate when to start the next query from|
??? info "[FundingRate](/../../schemas/funding_rate)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
|funding_rate<br>`fr` |string|True|The funding rate of the instrument, expressed in percentage points|
|funding_time<br>`ft` |string|True|The funding timestamp of the funding rate, expressed in unix nanoseconds|
|mark_price<br>`mp` |string|True|The mark price of the instrument at funding timestamp, expressed in `9` decimals|
|funding_rate_8_h_avg<br>`fr1` |string|True|The 8h average funding rate of the instrument, expressed in percentage points|
@@ -0,0 +1,6 @@
!!! info "[ApiGetAllInitialLeverageRequest](/../../schemas/api_get_all_initial_leverage_request)"
The request to get the initial leverage of a sub account<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The sub account ID to get the leverage for|
@@ -0,0 +1,13 @@
!!! info "[ApiGetAllInitialLeverageResponse](/../../schemas/api_get_all_initial_leverage_response)"
The response to get the initial leverage of a sub account<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|results<br>`r` |[InitialLeverageResult]|True|The initial leverage of the sub account|
??? info "[InitialLeverageResult](/../../schemas/initial_leverage_result)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to get the leverage for|
|leverage<br>`l` |string|True|The initial leverage of the sub account|
|min_leverage<br>`ml` |string|True|The min leverage this sub account can set|
|max_leverage<br>`ml1` |string|True|The max leverage this sub account can set|
@@ -0,0 +1,6 @@
!!! info "[ApiGetAllInstrumentsRequest](/../../schemas/api_get_all_instruments_request)"
Fetch all instruments<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|is_active<br>`ia` |boolean|False<br>`false`|Fetch only active instruments|
@@ -0,0 +1,44 @@
!!! info "[ApiGetAllInstrumentsResponse](/../../schemas/api_get_all_instruments_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[Instrument]|True|List of instruments|
??? info "[Instrument](/../../schemas/instrument)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
|instrument_hash<br>`ih` |string|True|The asset ID used for instrument signing.|
|base<br>`b` |string|True|The base currency|
|quote<br>`q` |string|True|The quote currency|
|kind<br>`k` |Kind|True|The kind of instrument|
|venues<br>`v` |[Venue]|True|Venues that this instrument can be traded at|
|settlement_period<br>`sp1` |InstrumentSettlementPeriod|True|The settlement period of the instrument|
|base_decimals<br>`bd` |integer|True|The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)|
|quote_decimals<br>`qd` |integer|True|The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)|
|tick_size<br>`ts` |string|True|The size of a single tick, expressed in price decimal units|
|min_size<br>`ms` |string|True|The minimum contract size, expressed in base asset decimal units|
|create_time<br>`ct` |string|True|Creation time in unix nanoseconds|
|max_position_size<br>`mp` |string|True|The maximum position size, expressed in base asset decimal units|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`ORDERBOOK` = 1|the trade is cleared on the orderbook venue|
|`RFQ` = 2|the trade is cleared on the RFQ venue|
??? info "[InstrumentSettlementPeriod](/../../schemas/instrument_settlement_period)"
|Value| Description |
|-|-|
|`PERPETUAL` = 1|Instrument settles through perpetual funding cycles|
|`DAILY` = 2|Instrument settles at an expiry date, marked as a daily instrument|
|`WEEKLY` = 3|Instrument settles at an expiry date, marked as a weekly instrument|
|`MONTHLY` = 4|Instrument settles at an expiry date, marked as a monthly instrument|
|`QUARTERLY` = 5|Instrument settles at an expiry date, marked as a quarterly instrument|
@@ -0,0 +1,5 @@
!!! info "[ApiGetCurrencyRequest](/../../schemas/api_get_currency_request)"
Fetch all currencies<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
@@ -0,0 +1,13 @@
!!! info "[ApiGetCurrencyResponse](/../../schemas/api_get_currency_response)"
The list of currencies<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[CurrencyDetail]|True|The list of currencies|
??? info "[CurrencyDetail](/../../schemas/currency_detail)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|id<br>`i` |integer|True|The integer value of the currency|
|symbol<br>`s` |string|True|The name of the currency|
|balance_decimals<br>`bd` |integer|True|The balance decimals of the currency|
|quantity_multiplier<br>`qm` |string|True|The quantity multiplier of the currency|
@@ -0,0 +1,5 @@
!!! info "[ApiGetEcosystemLeaderboardRequest](/../../schemas/api_get_ecosystem_leaderboard_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|calculate_from<br>`cf` |string|True|Start time of the epoch - phase|
|limit<br>`l` |integer|True|The number of accounts to return|
@@ -0,0 +1,25 @@
!!! info "[ApiGetEcosystemLeaderboardResponse](/../../schemas/api_get_ecosystem_leaderboard_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|points<br>`p` |[EcosystemPoint]|True|The list of ecosystem points|
??? info "[EcosystemPoint](/../../schemas/ecosystem_point)"
<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_id<br>`ai` |string|True|The off chain account id|
|main_account_id<br>`ma` |string|True|The main account id|
|total_point<br>`tp` |string|True|Total ecosystem point|
|direct_invite_count<br>`di` |integer|True|Direct invite count|
|indirect_invite_count<br>`ii` |integer|True|Indirect invite count|
|direct_invite_trading_volume<br>`di1` |string|True|Direct invite trading volume|
|indirect_invite_trading_volume<br>`ii1` |string|True|Indirect invite trading volume|
|calculate_at<br>`ca` |string|True|The time when the ecosystem point is calculated|
|calculate_from<br>`cf` |string|True|Start time of the epoch - phase|
|calculate_to<br>`ct` |string|True|End time of the epoch - phase|
|rank<br>`r` |integer|True|The rank of the account in the ecosystem|
|epoch<br>`e` |integer|True|The epoch number of the ecosystem point|
|brokered_trading_volume<br>`bt` |string|True|Brokered trading volume|
|brokered_trading_point<br>`bt1` |string|True|Brokered trading point|
|referee_kyc_point<br>`rk` |string|True|Referee KYC point|
|referrer_kyc_point<br>`rk1` |string|True|Referrer KYC point|
@@ -0,0 +1,7 @@
!!! info "[ApiGetEcosystemReferralStatResponse](/../../schemas/api_get_ecosystem_referral_stat_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|direct_invite_count<br>`di` |integer|True|Direct invite count|
|indirect_invite_count<br>`ii` |integer|True|Indirect invite count|
|direct_invite_trading_volume<br>`di1` |string|True|Total volume traded by direct invites multiple by 1e9|
|indirect_invite_trading_volume<br>`ii1` |string|True|Total volume traded by indirect invites multiple by 1e9|
@@ -0,0 +1,19 @@
!!! info "[ApiGetFilteredInstrumentsRequest](/../../schemas/api_get_filtered_instruments_request)"
Fetch a list of instruments based on the filters provided<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|kind<br>`k` |[Kind]|False<br>`all`|The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned|
|base<br>`b` |[string]|False<br>`all`|The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned|
|quote<br>`q` |[string]|False<br>`all`|The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned|
|is_active<br>`ia` |boolean|False<br>`false`|Request for active instruments only|
|limit<br>`l` |integer|False<br>`500`|The limit to query for. Defaults to 500; Max 100000|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
@@ -0,0 +1,44 @@
!!! info "[ApiGetFilteredInstrumentsResponse](/../../schemas/api_get_filtered_instruments_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[Instrument]|True|The instruments matching the request filter|
??? info "[Instrument](/../../schemas/instrument)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
|instrument_hash<br>`ih` |string|True|The asset ID used for instrument signing.|
|base<br>`b` |string|True|The base currency|
|quote<br>`q` |string|True|The quote currency|
|kind<br>`k` |Kind|True|The kind of instrument|
|venues<br>`v` |[Venue]|True|Venues that this instrument can be traded at|
|settlement_period<br>`sp1` |InstrumentSettlementPeriod|True|The settlement period of the instrument|
|base_decimals<br>`bd` |integer|True|The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)|
|quote_decimals<br>`qd` |integer|True|The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)|
|tick_size<br>`ts` |string|True|The size of a single tick, expressed in price decimal units|
|min_size<br>`ms` |string|True|The minimum contract size, expressed in base asset decimal units|
|create_time<br>`ct` |string|True|Creation time in unix nanoseconds|
|max_position_size<br>`mp` |string|True|The maximum position size, expressed in base asset decimal units|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`ORDERBOOK` = 1|the trade is cleared on the orderbook venue|
|`RFQ` = 2|the trade is cleared on the RFQ venue|
??? info "[InstrumentSettlementPeriod](/../../schemas/instrument_settlement_period)"
|Value| Description |
|-|-|
|`PERPETUAL` = 1|Instrument settles through perpetual funding cycles|
|`DAILY` = 2|Instrument settles at an expiry date, marked as a daily instrument|
|`WEEKLY` = 3|Instrument settles at an expiry date, marked as a weekly instrument|
|`MONTHLY` = 4|Instrument settles at an expiry date, marked as a monthly instrument|
|`QUARTERLY` = 5|Instrument settles at an expiry date, marked as a quarterly instrument|
@@ -0,0 +1,6 @@
!!! info "[ApiGetInstrumentRequest](/../../schemas/api_get_instrument_request)"
Fetch a single instrument by supplying the asset or instrument name<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
@@ -0,0 +1,44 @@
!!! info "[ApiGetInstrumentResponse](/../../schemas/api_get_instrument_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |Instrument|True|The instrument matching the request asset|
??? info "[Instrument](/../../schemas/instrument)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
|instrument_hash<br>`ih` |string|True|The asset ID used for instrument signing.|
|base<br>`b` |string|True|The base currency|
|quote<br>`q` |string|True|The quote currency|
|kind<br>`k` |Kind|True|The kind of instrument|
|venues<br>`v` |[Venue]|True|Venues that this instrument can be traded at|
|settlement_period<br>`sp1` |InstrumentSettlementPeriod|True|The settlement period of the instrument|
|base_decimals<br>`bd` |integer|True|The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)|
|quote_decimals<br>`qd` |integer|True|The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)|
|tick_size<br>`ts` |string|True|The size of a single tick, expressed in price decimal units|
|min_size<br>`ms` |string|True|The minimum contract size, expressed in base asset decimal units|
|create_time<br>`ct` |string|True|Creation time in unix nanoseconds|
|max_position_size<br>`mp` |string|True|The maximum position size, expressed in base asset decimal units|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`ORDERBOOK` = 1|the trade is cleared on the orderbook venue|
|`RFQ` = 2|the trade is cleared on the RFQ venue|
??? info "[InstrumentSettlementPeriod](/../../schemas/instrument_settlement_period)"
|Value| Description |
|-|-|
|`PERPETUAL` = 1|Instrument settles through perpetual funding cycles|
|`DAILY` = 2|Instrument settles at an expiry date, marked as a daily instrument|
|`WEEKLY` = 3|Instrument settles at an expiry date, marked as a weekly instrument|
|`MONTHLY` = 4|Instrument settles at an expiry date, marked as a monthly instrument|
|`QUARTERLY` = 5|Instrument settles at an expiry date, marked as a quarterly instrument|
@@ -0,0 +1,45 @@
!!! info "[ApiGetLatestLPSnapshotRequest](/../../schemas/api_get_latest_lp_snapshot_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|kind<br>`k` |Kind|False<br>`0`|The kind filter to apply|
|base<br>`b` |Currency|False<br>`0`|The base filter to apply|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
@@ -0,0 +1,14 @@
!!! info "[ApiGetLatestLPSnapshotResponse](/../../schemas/api_get_latest_lp_snapshot_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|snapshot<br>`s` |ApproximateLPSnapshot|True|The latest LP snapshot|
??? info "[ApproximateLPSnapshot](/../../schemas/approximate_lp_snapshot)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|main_account_id<br>`ma` |string|True|The main account id|
|underlying_multiplier<br>`um` |string|True|Underlying multiplier|
|market_share_multiplier<br>`ms` |string|True|Market share multiplier|
|bid_fast_market_multiplier<br>`bf` |integer|True|Fast market multiplier|
|ask_fast_market_multiplier<br>`af` |integer|True|Fast market multiplier|
|liquidity_score<br>`ls` |string|True|Liquidity score|
|calculate_at<br>`ca` |string|True|The time when the snapshot was calculated|
@@ -0,0 +1,54 @@
!!! info "[ApiGetListEpochBadgeResponse](/../../schemas/api_get_list_epoch_badge_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[EpochBadge]|True|The list of epoch badges|
??? info "[EpochBadge](/../../schemas/epoch_badge)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_id<br>`ai` |string|True|The off chain account id|
|main_account_id<br>`ma` |string|True|The account ID|
|type<br>`t` |RewardProgramType|True|The type of the reward program|
|epoch<br>`e` |integer|True|The epoch number|
|epoch_start_time<br>`es` |string|True|The start time of the epoch|
|epoch_end_time<br>`ee` |string|True|The end time of the epoch|
|badge<br>`b` |EpochBadgeType|True|The type of the badge|
|distributed_badges<br>`db` |[EpochBadgeType]|True|The distributed badges|
|total_point<br>`tp` |string|True|Total point|
|rank<br>`r` |integer|True|Rank|
|claimed_at<br>`ca` |string|True|The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process|
??? info "[RewardProgramType](/../../schemas/reward_program_type)"
|Value| Description |
|-|-|
|`ECOSYSTEM` = 1||
|`TRADER` = 2||
|`LP` = 3||
??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)"
|Value| Description |
|-|-|
|`CHAMPION` = 1|Champion|
|`LEGEND` = 2|Legend|
|`VETERAN` = 3|Veteran|
|`ELITE` = 4|Elite|
|`MASTER` = 5|Master|
|`EXPERT` = 6|Expert|
|`WARRIOR` = 7|Warrior|
|`SERGEANT` = 8|Sergeant|
|`RANGER` = 9|Ranger|
|`CHALLENGER` = 10|Challenger|
|`APPRENTICE` = 11|Apprentice|
|`ROOKIE` = 12|Rookie|
??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)"
|Value| Description |
|-|-|
|`CHAMPION` = 1|Champion|
|`LEGEND` = 2|Legend|
|`VETERAN` = 3|Veteran|
|`ELITE` = 4|Elite|
|`MASTER` = 5|Master|
|`EXPERT` = 6|Expert|
|`WARRIOR` = 7|Warrior|
|`SERGEANT` = 8|Sergeant|
|`RANGER` = 9|Ranger|
|`CHALLENGER` = 10|Challenger|
|`APPRENTICE` = 11|Apprentice|
|`ROOKIE` = 12|Rookie|
@@ -0,0 +1,9 @@
!!! info "[ApiGetListFlatReferralRequest](/../../schemas/api_get_list_flat_referral_request)"
startTime and endTime are optional parameters. The semantics of these parameters are as follows:<ul><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|referral_id<br>`ri` |string|True|The off chain referrer account id to get all flat referrals|
|start_time<br>`st` |string|False<br>`0`|Optional. Start time in unix nanoseconds|
|end_time<br>`et` |string|False<br>`now()`|Optional. End time in unix nanoseconds|
|account_id<br>`ai` |string|True|The off chain account id to get all user's referrers|
@@ -0,0 +1,20 @@
!!! info "[ApiGetListFlatReferralResponse](/../../schemas/api_get_list_flat_referral_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|flat_referrals<br>`fr` |[FlatReferral]|True|The list of flat referrals|
??? info "[FlatReferral](/../../schemas/flat_referral)"
<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_id<br>`ai` |string|True|The off chain account id|
|referrer_id<br>`ri` |string|True|The off chain referrer account id|
|referrer_level<br>`rl` |integer|True|The referrer level; 1: direct referrer, 2: indirect referrer|
|account_create_time<br>`ac` |string|True|The account creation time|
|main_account_id<br>`ma` |string|True|The main account id|
|referrer_main_account_id<br>`rm` |string|True|The referrer main account id|
|is_business<br>`ib` |boolean|True|The account is a business account or not|
|is_kyc_completed<br>`ik` |boolean|True|The account is KYC verified or not|
|kyc_completed_at<br>`kc` |string|True|The KYC completed time|
|kyc_type<br>`kt` |string|True|The KYC type, can be 'individual' or 'business'|
|kyc_first_completed_at<br>`kf` |string|True|The first KYC completed time|
@@ -0,0 +1,31 @@
!!! info "[ApiGetListRewardEpochResponse](/../../schemas/api_get_list_reward_epoch_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|ecosystem_epochs<br>`ee` |[RewardEpochInfo]|True|The list of epoch for ecosystem reward|
|trading_epochs<br>`te` |[RewardEpochInfo]|True|The list of epoch for trader reward and lp reward|
??? info "[RewardEpochInfo](/../../schemas/reward_epoch_info)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|epoch<br>`e` |integer|True|The epoch number|
|epoch_start_time<br>`es` |string|True|The start time of the epoch|
|epoch_end_time<br>`ee` |string|True|The end time of the epoch|
|status<br>`s` |RewardEpochStatus|True|The status of the epoch|
??? info "[RewardEpochStatus](/../../schemas/reward_epoch_status)"
|Value| Description |
|-|-|
|`PAST` = 1|Past|
|`CURRENT` = 2|Current|
|`FUTURE` = 3|Future|
??? info "[RewardEpochInfo](/../../schemas/reward_epoch_info)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|epoch<br>`e` |integer|True|The epoch number|
|epoch_start_time<br>`es` |string|True|The start time of the epoch|
|epoch_end_time<br>`ee` |string|True|The end time of the epoch|
|status<br>`s` |RewardEpochStatus|True|The status of the epoch|
??? info "[RewardEpochStatus](/../../schemas/reward_epoch_status)"
|Value| Description |
|-|-|
|`PAST` = 1|Past|
|`CURRENT` = 2|Current|
|`FUTURE` = 3|Future|
@@ -0,0 +1,24 @@
!!! info "[ApiGetLPConfigRequest](/../../schemas/api_get_lp_config_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|kind<br>`k` |Kind|True|The kind filter to apply|
|base<br>`b` |Currency|True|The base filter to apply|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
@@ -0,0 +1,7 @@
!!! info "[ApiGetLPConfigResponse](/../../schemas/api_get_lp_config_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|spread_score_multiplier<br>`ss` |string|True|The spread score multiplier|
|depth_score_multiplier<br>`ds` |string|True|The depth score multiplier|
|market_share_multiplier<br>`ms` |string|True|The market share multiplier|
|is_lp_maker<br>`il` |boolean|True|Is LP maker|
@@ -0,0 +1,45 @@
!!! info "[ApiGetLPInfoRequest](/../../schemas/api_get_lp_info_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|kind<br>`k` |Kind|True|The kind filter to apply|
|base<br>`b` |Currency|False<br>`0`|The base filter to apply|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
@@ -0,0 +1,11 @@
!!! info "[ApiGetLPInfoResponse](/../../schemas/api_get_lp_info_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|is_lp_maker<br>`il` |boolean|True|Is LP maker|
|spread_score_value_multiplier<br>`ss` |string|True|The spread score value multiplier|
|depth_score_value_multiplier<br>`ds` |string|True|The depth score value multiplier|
|market_share_value_multiplier<br>`ms` |string|True|The market share value multiplier|
|underlying_multiplier<br>`um` |string|True|Underlying multiplier|
|market_share_multiplier<br>`ms1` |string|True|The market share multiplier, equal to the maker trading volume in the past 2 hours|
|ask_fast_market_multiplier<br>`af` |integer|True|Ask fast market multiplier|
|bid_fast_market_multiplier<br>`bf` |integer|True|Bid fast market multiplier|
@@ -0,0 +1,47 @@
!!! info "[ApiGetLPLeaderboardRequest](/../../schemas/api_get_lp_leaderboard_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|epoch<br>`e` |integer|False<br>`0`|The epoch to filter|
|limit<br>`l` |integer|True|The number of accounts to return|
|kind<br>`k` |Kind|True|The kind filter to apply|
|base<br>`b` |Currency|True|The base filter to apply|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
@@ -0,0 +1,10 @@
!!! info "[ApiGetLPLeaderboardResponse](/../../schemas/api_get_lp_leaderboard_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|points<br>`p` |[ApproximateLPPoint]|True|The list of LP points|
??? info "[ApproximateLPPoint](/../../schemas/approximate_lp_point)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|off_chain_account_id<br>`oc` |string|True|The off chain account id|
|liquidity_score<br>`ls` |string|True|Liquidity score|
|rank<br>`r` |integer|True|The rank of user in the LP leaderboard|
@@ -0,0 +1,46 @@
!!! info "[ApiGetLPPointRequest](/../../schemas/api_get_lp_point_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|epoch<br>`e` |integer|False<br>`0`|The epoch to filter|
|kind<br>`k` |Kind|False<br>`0`|Optional. The kind filter to apply|
|base<br>`b` |Currency|False<br>`0`|Optional. The base filter to apply|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
@@ -0,0 +1,11 @@
!!! info "[ApiGetLPPointResponse](/../../schemas/api_get_lp_point_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|point<br>`p` |LPPoint|True|LP points of user|
|maker_count<br>`mc` |integer|True|The number of maker|
??? info "[LPPoint](/../../schemas/lp_point)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|main_account_id<br>`ma` |string|True|The main account id|
|liquidity_score<br>`ls` |string|True|Liquidity score|
|rank<br>`r` |integer|True|The rank of user in the LP leaderboard|
@@ -0,0 +1,14 @@
!!! info "[ApiGetMarginTiersResponse](/../../schemas/api_get_margin_tiers_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|results<br>`r` |[AssetMarginTierResponse]|True||
??? info "[AssetMarginTierResponse](/../../schemas/asset_margin_tier_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|asset<br>`a` |string|True||
|tiers<br>`t` |[MarginTierResponse]|True||
??? info "[MarginTierResponse](/../../schemas/margin_tier_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|lower_bound<br>`lb` |string|True||
|rate<br>`r` |string|True||
@@ -0,0 +1,6 @@
!!! info "[ApiGetOrderGroupRequest](/../../schemas/api_get_order_group_request)"
Retrieves the grouping of non-cancelled, non-filled client orders for a given subaccount when the grouping exist.<br><br>helping to identify TP/SL pairs or other order relationships within the account.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The subaccount ID for which the order groups should be retrieved.|
@@ -0,0 +1,12 @@
!!! info "[ApiGetOrderGroupResponse](/../../schemas/api_get_order_group_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[ClientOrderIDsByGroup]|True|A list of client orders grouped by their associated order group.<br>Each entry in the list contains a `groupID` and the corresponding `clientOrderID`s<br>that belong to that group.|
??? info "[ClientOrderIDsByGroup](/../../schemas/client_order_i_ds_by_group)"
Grouping for the client order id and their associated groups.<br><br>This is used to define TP/SL pairs or other order groupings after loading the list of Open Orders.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|group_id<br>`gi` |string|True|The group this order belongs to. It can be used to define TP/SL pairs or other order groupings|
|client_order_id<br>`co` |[string]|True|List of client order IDs in the group|
|sub_account_id<br>`sa` |string|True|The sub account ID that these orders belong to|
@@ -0,0 +1,8 @@
!!! info "[ApiGetOrderRequest](/../../schemas/api_get_order_request)"
Retrieve the order for the account. Either `order_id` or `client_order_id` must be provided.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The subaccount ID to filter by|
|order_id<br>`oi` |string|False<br>`0`|Filter for `order_id`|
|client_order_id<br>`co` |string|False<br>`0`|Filter for `client_order_id`|
+158
View File
@@ -0,0 +1,158 @@
!!! info "[ApiGetOrderResponse](/../../schemas/api_get_order_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |Order|True|The order object for the requested filter|
??? info "[Order](/../../schemas/order)"
Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.<br>GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.<br>This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.<br>Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.<br><br>All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.<br>This minimizes the amount of trust users have to offer to GRVT<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order_id<br>`oi` |string|False<br>`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend|
|sub_account_id<br>`sa` |string|True|The subaccount initiating the order|
|is_market<br>`im` |boolean|False<br>`false`|If the order is a market order<br>Market Orders do not have a limit price, and are always executed according to the maker order price.<br>Market Orders must always be taker orders|
|time_in_force<br>`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:<ul><br><li>PARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg</li><br><li>FULL EXECUTION = AON / FOK - only allows full size execution on all legs</li><br><li>TAKER ONLY = IOC / FOK - only allows taker orders</li><br><li>MAKER OR TAKER = GTT / AON - allows maker or taker orders</li><br></ul>Exchange only supports (GTT, IOC, FOK)<br>RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)|
|post_only<br>`po` |boolean|False<br>`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.<br>If False, Order can be either a maker or taker order. <b>In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.</b><br><br>| | Must Fill All | Can Fill Partial |<br>| - | - | - |<br>| Must Be Taker | FOK + False | IOC + False |<br>| Can Be Either | AON + False | GTC + False |<br>| Must Be Maker | AON + True | GTC + True |<br>|
|reduce_only<br>`ro` |boolean|False<br>`false`|If True, Order must reduce the position size, or be cancelled|
|legs<br>`l` |[OrderLeg]|True|The legs present in this order<br>The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice|
|signature<br>`s` |Signature|True|The signature approving this order|
|metadata<br>`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client|
|state<br>`s1` |OrderState|False<br>`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client|
??? info "[TimeInForce](/../../schemas/time_in_force)"
| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Fill Immediately | FOK | IOC |
| Can Fill Till Time | AON | GTC |
<br>
|Value| Description |
|-|-|
|`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired|
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
|`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to trade in this leg|
|size<br>`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.|
|limit_price<br>`lp` |string|False<br>`0`|The limit price of the order leg, expressed in `9` decimals.<br>This is the number of quote currency units to pay/receive for this leg.<br>This should be `null/0` if the order is a market order|
|is_buying_asset<br>`ib` |boolean|True|Specifies if the order leg is a buy or sell|
??? info "[Signature](/../../schemas/signature)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|signer<br>`s` |string|True|The address (public key) of the wallet signing the payload|
|r<br>`r` |string|True|Signature R|
|s<br>`s1` |string|True|Signature S|
|v<br>`v` |integer|True|Signature V|
|expiration<br>`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
|nonce<br>`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.<br>ie. You can send the same exact instruction twice with different nonces.<br>When the same nonce is used, the same payload will generate the same signature.<br>Our system will consider the payload a duplicate, and ignore it.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.<br>Hence, fields in here are never signed, and is never transmitted to the smart contract.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|create_time<br>`ct` |string|False<br>`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds|
|trigger<br>`t` |TriggerOrderMetadata|False<br>``|Trigger fields are used to support any type of trigger order such as TP/SL|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)"
Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).<br><br>Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_type<br>`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc|
|tpsl<br>`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>|
??? info "[TriggerType](/../../schemas/trigger_type)"
Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.<br><br>Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.|
|`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.|
|`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.|
??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)"
Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>### Fields:<br>- **triggerBy**: Defines the price type that activates the order (e.g., index price).<br>- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_by<br>`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price<br>`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
|close_position<br>`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.<br><br>Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|no trigger condition|
|`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price|
|`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price|
|`MID` = 3|MID - Order is activated when the mid price reaches the trigger price|
|`MARK` = 4|MARK - Order is activated when the mark price reaches the trigger price|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
|`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
|`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
|`DERISK_MUST_BE_IOC` = 33|the derisk order must be an IOC order|
|`DERISK_MUST_BE_REDUCE_ONLY` = 34|the derisk order must be a reduce-only order|
|`DERISK_NOT_SUPPORTED` = 35|derisk is not supported|
|`INVALID_ORDER_TYPE` = 36|the order type is invalid|
|`CURRENCY_NOT_DEFINED` = 37|the currency is not defined|
@@ -0,0 +1,4 @@
!!! info "[ApiGetTraderStatResponse](/../../schemas/api_get_trader_stat_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|total_fee<br>`tf` |string|True|Total fee paid|
@@ -0,0 +1,6 @@
!!! info "[ApiGetUserEcosystemPointRequest](/../../schemas/api_get_user_ecosystem_point_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_id<br>`ai` |string|True|The off chain account id|
|calculate_from<br>`cf` |string|True|Start time of the epoch - phase|
|include_user_rank<br>`iu` |boolean|True|Include user rank in the response|
@@ -0,0 +1,25 @@
!!! info "[ApiGetUserEcosystemPointResponse](/../../schemas/api_get_user_ecosystem_point_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|points<br>`p` |[EcosystemPoint]|True|The list of ecosystem points|
??? info "[EcosystemPoint](/../../schemas/ecosystem_point)"
<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_id<br>`ai` |string|True|The off chain account id|
|main_account_id<br>`ma` |string|True|The main account id|
|total_point<br>`tp` |string|True|Total ecosystem point|
|direct_invite_count<br>`di` |integer|True|Direct invite count|
|indirect_invite_count<br>`ii` |integer|True|Indirect invite count|
|direct_invite_trading_volume<br>`di1` |string|True|Direct invite trading volume|
|indirect_invite_trading_volume<br>`ii1` |string|True|Indirect invite trading volume|
|calculate_at<br>`ca` |string|True|The time when the ecosystem point is calculated|
|calculate_from<br>`cf` |string|True|Start time of the epoch - phase|
|calculate_to<br>`ct` |string|True|End time of the epoch - phase|
|rank<br>`r` |integer|True|The rank of the account in the ecosystem|
|epoch<br>`e` |integer|True|The epoch number of the ecosystem point|
|brokered_trading_volume<br>`bt` |string|True|Brokered trading volume|
|brokered_trading_point<br>`bt1` |string|True|Brokered trading point|
|referee_kyc_point<br>`rk` |string|True|Referee KYC point|
|referrer_kyc_point<br>`rk1` |string|True|Referrer KYC point|
@@ -0,0 +1,5 @@
!!! info "[ApiGetVerifiedEcosystemLeaderboardRequest](/../../schemas/api_get_verified_ecosystem_leaderboard_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|calculate_from<br>`cf` |string|True|Start time of the epoch|
|completed_kyc_before<br>`ck` |string|True|Completed KYC before this time|
@@ -0,0 +1,6 @@
!!! info "[ApiLatestSnapSubAccountsRequest](/../../schemas/api_latest_snap_sub_accounts_request)"
The request to get the latest snapshot of list sub account<br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_i_ds<br>`sa` |[string]|True|The list of sub account ids to query|
@@ -0,0 +1,110 @@
!!! info "[ApiLatestSnapSubAccountsResponse](/../../schemas/api_latest_snap_sub_accounts_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[SubAccount]|True|The sub account history matching the request sub account|
??? info "[SubAccount](/../../schemas/sub_account)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|event_time<br>`et` |string|True|Time at which the event was emitted in unix nanoseconds|
|sub_account_id<br>`sa` |string|True|The sub account ID this entry refers to|
|margin_type<br>`mt` |MarginType|True|The type of margin algorithm this subaccount uses|
|settle_currency<br>`sc` |Currency|True|The settlement, margin, and reporting currency of this account.<br>This subaccount can only open positions quoted in this currency<br><br>In the future, when users select a Multi-Currency Margin Type, this will be USD<br>All other assets are converted to this currency for the purpose of calculating margin|
|unrealized_pnl<br>`up` |string|True|The total unrealized PnL of all positions owned by this subaccount, denominated in quote currency decimal units.<br>`unrealized_pnl = sum(position.unrealized_pnl * position.quote_index_price) / settle_index_price`|
|total_equity<br>`te` |string|True|The notional value of your account if all positions are closed, excluding trading fees (reported in `settle_currency`).<br>`total_equity = sum(spot_balance.balance * spot_balance.index_price) / settle_index_price + unrealized_pnl`|
|initial_margin<br>`im` |string|True|The `total_equity` required to open positions in the account (reported in `settle_currency`).<br>Computation is different depending on account's `margin_type`|
|maintenance_margin<br>`mm` |string|True|The `total_equity` required to avoid liquidation of positions in the account (reported in `settle_currency`).<br>Computation is different depending on account's `margin_type`|
|available_balance<br>`ab` |string|True|The notional value available to transfer out of the trading account into the funding account (reported in `settle_currency`).<br>`available_balance = total_equity - initial_margin - min(unrealized_pnl, 0)`|
|spot_balances<br>`sb` |[SpotBalance]|True|The list of spot assets owned by this sub account, and their balances|
|positions<br>`p` |[Positions]|True|The list of positions owned by this sub account|
|settle_index_price<br>`si` |string|True|The index price of the settle currency. (reported in `USD`)|
??? info "[MarginType](/../../schemas/margin_type)"
|Value| Description |
|-|-|
|`SIMPLE_CROSS_MARGIN` = 2|Simple Cross Margin Mode: all assets have a predictable margin impact, the whole subaccount shares a single margin|
|`PORTFOLIO_CROSS_MARGIN` = 3|Portfolio Cross Margin Mode: asset margin impact is analysed on portfolio level, the whole subaccount shares a single margin|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
??? info "[SpotBalance](/../../schemas/spot_balance)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|currency<br>`c` |Currency|True|The currency you hold a spot balance in|
|balance<br>`b` |string|True|This currency's balance in this trading account.|
|index_price<br>`ip` |string|True|The index price of this currency. (reported in `USD`)|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
??? info "[Positions](/../../schemas/positions)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|event_time<br>`et` |string|True|Time at which the event was emitted in unix nanoseconds|
|sub_account_id<br>`sa` |string|True|The sub account ID that participated in the trade|
|instrument<br>`i` |string|True|The instrument being represented|
|size<br>`s` |string|True|The size of the position, expressed in base asset decimal units. Negative for short positions|
|notional<br>`n` |string|True|The notional value of the position, negative for short assets, expressed in quote asset decimal units|
|entry_price<br>`ep` |string|True|The entry price of the position, expressed in `9` decimals<br>Whenever increasing the size of a position, the entry price is updated to the new average entry price<br>`new_entry_price = (old_entry_price * old_size + trade_price * trade_size) / (old_size + trade_size)`|
|exit_price<br>`ep1` |string|True|The exit price of the position, expressed in `9` decimals<br>Whenever decreasing the size of a position, the exit price is updated to the new average exit price<br>`new_exit_price = (old_exit_price * old_exit_trade_size + trade_price * trade_size) / (old_exit_trade_size + trade_size)`|
|mark_price<br>`mp` |string|True|The mark price of the position, expressed in `9` decimals|
|unrealized_pnl<br>`up` |string|True|The unrealized PnL of the position, expressed in quote asset decimal units<br>`unrealized_pnl = (mark_price - entry_price) * size`|
|realized_pnl<br>`rp` |string|True|The realized PnL of the position, expressed in quote asset decimal units<br>`realized_pnl = (exit_price - entry_price) * exit_trade_size`|
|total_pnl<br>`tp` |string|True|The total PnL of the position, expressed in quote asset decimal units<br>`total_pnl = realized_pnl + unrealized_pnl`|
|roi<br>`r` |string|True|The ROI of the position, expressed as a percentage<br>`roi = (total_pnl / (entry_price * abs(size))) * 100^`|
|quote_index_price<br>`qi` |string|True|The index price of the quote currency. (reported in `USD`)|
|est_liquidation_price<br>`el` |string|True|The estimated liquidation price|
|leverage<br>`l` |string|True|The current leverage value for this position|
@@ -0,0 +1,4 @@
!!! info "[ApiListAggregatedAccountSummaryRequest](/../../schemas/api_list_aggregated_account_summary_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|main_account_ids<br>`ma` |[unknown]|True|The list of main account ID to request for|
@@ -0,0 +1,53 @@
!!! info "[ApiListAggregatedAccountSummaryResponse](/../../schemas/api_list_aggregated_account_summary_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_summaries<br>`as` |[ApiAggregatedAccountSummaryResponse]|True|The list of aggregated account summaries of requested main accounts|
??? info "[ApiAggregatedAccountSummaryResponse](/../../schemas/api_aggregated_account_summary_response)"
The aggregated account summary, that reports the total equity and spot balances of a funding (main) account, and its constituent trading (sub) accounts<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |AggregatedAccountSummary|True|The aggregated account summary|
??? info "[AggregatedAccountSummary](/../../schemas/aggregated_account_summary)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|main_account_id<br>`ma` |string|True|The main account ID of the account to which the summary belongs|
|total_equity<br>`te` |string|True|Total equity of the main (+ sub) account, denominated in USD|
|spot_balances<br>`sb` |[SpotBalance]|True|The list of spot assets owned by this main (+ sub) account, and their balances|
??? info "[SpotBalance](/../../schemas/spot_balance)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|currency<br>`c` |Currency|True|The currency you hold a spot balance in|
|balance<br>`b` |string|True|This currency's balance in this trading account.|
|index_price<br>`ip` |string|True|The index price of this currency. (reported in `USD`)|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
@@ -0,0 +1,6 @@
!!! info "[ApiMiniTickerRequest](/../../schemas/api_mini_ticker_request)"
Retrieves a single mini ticker value for a single instrument. Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
@@ -0,0 +1,18 @@
!!! info "[ApiMiniTickerResponse](/../../schemas/api_mini_ticker_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |MiniTicker|True|The mini ticker matching the request asset|
??? info "[MiniTicker](/../../schemas/mini_ticker)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|event_time<br>`et` |string|False<br>`None`|Time at which the event was emitted in unix nanoseconds|
|instrument<br>`i` |string|False<br>`None`|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
|mark_price<br>`mp` |string|False<br>`None`|The mark price of the instrument, expressed in `9` decimals|
|index_price<br>`ip` |string|False<br>`None`|The index price of the instrument, expressed in `9` decimals|
|last_price<br>`lp` |string|False<br>`None`|The last traded price of the instrument (also close price), expressed in `9` decimals|
|last_size<br>`ls` |string|False<br>`None`|The number of assets traded in the last trade, expressed in base asset decimal units|
|mid_price<br>`mp1` |string|False<br>`None`|The mid price of the instrument, expressed in `9` decimals|
|best_bid_price<br>`bb` |string|False<br>`None`|The best bid price of the instrument, expressed in `9` decimals|
|best_bid_size<br>`bb1` |string|False<br>`None`|The number of assets offered on the best bid price of the instrument, expressed in base asset decimal units|
|best_ask_price<br>`ba` |string|False<br>`None`|The best ask price of the instrument, expressed in `9` decimals|
|best_ask_size<br>`ba1` |string|False<br>`None`|The number of assets offered on the best ask price of the instrument, expressed in base asset decimal units|
@@ -0,0 +1,16 @@
!!! info "[ApiOpenOrdersRequest](/../../schemas/api_open_orders_request)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The subaccount ID to filter by|
|kind<br>`k` |[Kind]|False<br>`all`|The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned|
|base<br>`b` |[string]|False<br>`all`|The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned|
|quote<br>`q` |[string]|False<br>`all`|The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
@@ -0,0 +1,160 @@
!!! info "[ApiOpenOrdersResponse](/../../schemas/api_open_orders_response)"
Retrieves all open orders for the account. This may not match new orders in flight.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[Order]|True|The Open Orders matching the request filter|
??? info "[Order](/../../schemas/order)"
Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.<br>GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.<br>This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.<br>Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.<br><br>All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.<br>This minimizes the amount of trust users have to offer to GRVT<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order_id<br>`oi` |string|False<br>`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend|
|sub_account_id<br>`sa` |string|True|The subaccount initiating the order|
|is_market<br>`im` |boolean|False<br>`false`|If the order is a market order<br>Market Orders do not have a limit price, and are always executed according to the maker order price.<br>Market Orders must always be taker orders|
|time_in_force<br>`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:<ul><br><li>PARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg</li><br><li>FULL EXECUTION = AON / FOK - only allows full size execution on all legs</li><br><li>TAKER ONLY = IOC / FOK - only allows taker orders</li><br><li>MAKER OR TAKER = GTT / AON - allows maker or taker orders</li><br></ul>Exchange only supports (GTT, IOC, FOK)<br>RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)|
|post_only<br>`po` |boolean|False<br>`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.<br>If False, Order can be either a maker or taker order. <b>In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.</b><br><br>| | Must Fill All | Can Fill Partial |<br>| - | - | - |<br>| Must Be Taker | FOK + False | IOC + False |<br>| Can Be Either | AON + False | GTC + False |<br>| Must Be Maker | AON + True | GTC + True |<br>|
|reduce_only<br>`ro` |boolean|False<br>`false`|If True, Order must reduce the position size, or be cancelled|
|legs<br>`l` |[OrderLeg]|True|The legs present in this order<br>The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice|
|signature<br>`s` |Signature|True|The signature approving this order|
|metadata<br>`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client|
|state<br>`s1` |OrderState|False<br>`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client|
??? info "[TimeInForce](/../../schemas/time_in_force)"
| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Fill Immediately | FOK | IOC |
| Can Fill Till Time | AON | GTC |
<br>
|Value| Description |
|-|-|
|`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired|
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
|`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to trade in this leg|
|size<br>`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.|
|limit_price<br>`lp` |string|False<br>`0`|The limit price of the order leg, expressed in `9` decimals.<br>This is the number of quote currency units to pay/receive for this leg.<br>This should be `null/0` if the order is a market order|
|is_buying_asset<br>`ib` |boolean|True|Specifies if the order leg is a buy or sell|
??? info "[Signature](/../../schemas/signature)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|signer<br>`s` |string|True|The address (public key) of the wallet signing the payload|
|r<br>`r` |string|True|Signature R|
|s<br>`s1` |string|True|Signature S|
|v<br>`v` |integer|True|Signature V|
|expiration<br>`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
|nonce<br>`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.<br>ie. You can send the same exact instruction twice with different nonces.<br>When the same nonce is used, the same payload will generate the same signature.<br>Our system will consider the payload a duplicate, and ignore it.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.<br>Hence, fields in here are never signed, and is never transmitted to the smart contract.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|create_time<br>`ct` |string|False<br>`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds|
|trigger<br>`t` |TriggerOrderMetadata|False<br>``|Trigger fields are used to support any type of trigger order such as TP/SL|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)"
Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).<br><br>Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_type<br>`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc|
|tpsl<br>`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>|
??? info "[TriggerType](/../../schemas/trigger_type)"
Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.<br><br>Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.|
|`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.|
|`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.|
??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)"
Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>### Fields:<br>- **triggerBy**: Defines the price type that activates the order (e.g., index price).<br>- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_by<br>`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price<br>`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
|close_position<br>`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.<br><br>Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|no trigger condition|
|`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price|
|`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price|
|`MID` = 3|MID - Order is activated when the mid price reaches the trigger price|
|`MARK` = 4|MARK - Order is activated when the mark price reaches the trigger price|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
|`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
|`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
|`DERISK_MUST_BE_IOC` = 33|the derisk order must be an IOC order|
|`DERISK_MUST_BE_REDUCE_ONLY` = 34|the derisk order must be a reduce-only order|
|`DERISK_NOT_SUPPORTED` = 35|derisk is not supported|
|`INVALID_ORDER_TYPE` = 36|the order type is invalid|
|`CURRENCY_NOT_DEFINED` = 37|the currency is not defined|
@@ -0,0 +1,22 @@
!!! info "[ApiOrderHistoryRequest](/../../schemas/api_order_history_request)"
Retrieves the order history for the account.<br><br>Pagination works as follows:<ul><li>We perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.</li><li>The lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.</li><li>If a `cursor` is provided, it will be used to fetch results from that point onwards.</li><li>Pagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.</li></ul><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The subaccount ID to filter by|
|kind<br>`k` |[Kind]|False<br>`all`|The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned|
|base<br>`b` |[string]|False<br>`all`|The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned|
|quote<br>`q` |[string]|False<br>`all`|The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned|
|start_time<br>`st` |string|False<br>`0`|The start time to apply in nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned|
|end_time<br>`et` |string|False<br>`now()`|The end time to apply in nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned|
|limit<br>`l` |integer|False<br>`500`|The limit to query for. Defaults to 500; Max 1000|
|cursor<br>`c` |string|False<br>`''`|The cursor to indicate when to start the query from|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
@@ -0,0 +1,159 @@
!!! info "[ApiOrderHistoryResponse](/../../schemas/api_order_history_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[Order]|True|The Open Orders matching the request filter|
|next<br>`n` |string|True|The cursor to indicate when to start the query from|
??? info "[Order](/../../schemas/order)"
Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.<br>GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.<br>This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.<br>Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.<br><br>All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.<br>This minimizes the amount of trust users have to offer to GRVT<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order_id<br>`oi` |string|False<br>`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend|
|sub_account_id<br>`sa` |string|True|The subaccount initiating the order|
|is_market<br>`im` |boolean|False<br>`false`|If the order is a market order<br>Market Orders do not have a limit price, and are always executed according to the maker order price.<br>Market Orders must always be taker orders|
|time_in_force<br>`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:<ul><br><li>PARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg</li><br><li>FULL EXECUTION = AON / FOK - only allows full size execution on all legs</li><br><li>TAKER ONLY = IOC / FOK - only allows taker orders</li><br><li>MAKER OR TAKER = GTT / AON - allows maker or taker orders</li><br></ul>Exchange only supports (GTT, IOC, FOK)<br>RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)|
|post_only<br>`po` |boolean|False<br>`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.<br>If False, Order can be either a maker or taker order. <b>In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.</b><br><br>| | Must Fill All | Can Fill Partial |<br>| - | - | - |<br>| Must Be Taker | FOK + False | IOC + False |<br>| Can Be Either | AON + False | GTC + False |<br>| Must Be Maker | AON + True | GTC + True |<br>|
|reduce_only<br>`ro` |boolean|False<br>`false`|If True, Order must reduce the position size, or be cancelled|
|legs<br>`l` |[OrderLeg]|True|The legs present in this order<br>The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice|
|signature<br>`s` |Signature|True|The signature approving this order|
|metadata<br>`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client|
|state<br>`s1` |OrderState|False<br>`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client|
??? info "[TimeInForce](/../../schemas/time_in_force)"
| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Fill Immediately | FOK | IOC |
| Can Fill Till Time | AON | GTC |
<br>
|Value| Description |
|-|-|
|`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired|
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
|`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to trade in this leg|
|size<br>`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.|
|limit_price<br>`lp` |string|False<br>`0`|The limit price of the order leg, expressed in `9` decimals.<br>This is the number of quote currency units to pay/receive for this leg.<br>This should be `null/0` if the order is a market order|
|is_buying_asset<br>`ib` |boolean|True|Specifies if the order leg is a buy or sell|
??? info "[Signature](/../../schemas/signature)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|signer<br>`s` |string|True|The address (public key) of the wallet signing the payload|
|r<br>`r` |string|True|Signature R|
|s<br>`s1` |string|True|Signature S|
|v<br>`v` |integer|True|Signature V|
|expiration<br>`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
|nonce<br>`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.<br>ie. You can send the same exact instruction twice with different nonces.<br>When the same nonce is used, the same payload will generate the same signature.<br>Our system will consider the payload a duplicate, and ignore it.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.<br>Hence, fields in here are never signed, and is never transmitted to the smart contract.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|create_time<br>`ct` |string|False<br>`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds|
|trigger<br>`t` |TriggerOrderMetadata|False<br>``|Trigger fields are used to support any type of trigger order such as TP/SL|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)"
Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).<br><br>Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_type<br>`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc|
|tpsl<br>`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>|
??? info "[TriggerType](/../../schemas/trigger_type)"
Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.<br><br>Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.|
|`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.|
|`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.|
??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)"
Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>### Fields:<br>- **triggerBy**: Defines the price type that activates the order (e.g., index price).<br>- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_by<br>`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price<br>`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
|close_position<br>`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.<br><br>Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|no trigger condition|
|`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price|
|`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price|
|`MID` = 3|MID - Order is activated when the mid price reaches the trigger price|
|`MARK` = 4|MARK - Order is activated when the mark price reaches the trigger price|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
|`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
|`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
|`DERISK_MUST_BE_IOC` = 33|the derisk order must be an IOC order|
|`DERISK_MUST_BE_REDUCE_ONLY` = 34|the derisk order must be a reduce-only order|
|`DERISK_NOT_SUPPORTED` = 35|derisk is not supported|
|`INVALID_ORDER_TYPE` = 36|the order type is invalid|
|`CURRENCY_NOT_DEFINED` = 37|the currency is not defined|
@@ -0,0 +1,8 @@
!!! info "[ApiOrderStateRequest](/../../schemas/api_order_state_request)"
Retrieve the order state for the account. Either `order_id` or `client_order_id` must be provided.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The subaccount ID to filter by|
|order_id<br>`oi` |string|False<br>`0`|Filter for `order_id`|
|client_order_id<br>`co` |string|False<br>`0`|Filter for `client_order_id`|
@@ -0,0 +1,55 @@
!!! info "[ApiOrderStateResponse](/../../schemas/api_order_state_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|state<br>`s` |OrderState|True|The order state for the requested filter|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
@@ -0,0 +1,7 @@
!!! info "[ApiOrderbookLevelsRequest](/../../schemas/api_orderbook_levels_request)"
Retrieves aggregated price depth for a single instrument, with a maximum depth of 10 levels. Do not use this to poll for data -- a websocket subscription is much more performant, and useful.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
|depth<br>`d` |integer|True|Depth of the order book to be retrieved (10, 50, 100, 500)|
@@ -0,0 +1,23 @@
!!! info "[ApiOrderbookLevelsResponse](/../../schemas/api_orderbook_levels_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |OrderbookLevels|True|The orderbook levels objects matching the request asset|
??? info "[OrderbookLevels](/../../schemas/orderbook_levels)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|event_time<br>`et` |string|True|Time at which the event was emitted in unix nanoseconds|
|instrument<br>`i` |string|True|The readable instrument name:<ul><li>Perpetual: `ETH_USDT_Perp`</li><li>Future: `BTC_USDT_Fut_20Oct23`</li><li>Call: `ETH_USDT_Call_20Oct23_2800`</li><li>Put: `ETH_USDT_Put_20Oct23_2800`</li></ul>|
|bids<br>`b` |[OrderbookLevel]|True|The list of best bids up till query depth|
|asks<br>`a` |[OrderbookLevel]|True|The list of best asks up till query depth|
??? info "[OrderbookLevel](/../../schemas/orderbook_level)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|price<br>`p` |string|True|The price of the level, expressed in `9` decimals|
|size<br>`s` |string|True|The number of assets offered, expressed in base asset decimal units|
|num_orders<br>`no` |integer|True|The number of open orders at this level|
??? info "[OrderbookLevel](/../../schemas/orderbook_level)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|price<br>`p` |string|True|The price of the level, expressed in `9` decimals|
|size<br>`s` |string|True|The number of assets offered, expressed in base asset decimal units|
|num_orders<br>`no` |integer|True|The number of open orders at this level|
@@ -0,0 +1,18 @@
!!! info "[ApiPositionsRequest](/../../schemas/api_positions_request)"
Query the positions of a sub account<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The sub account ID to request for|
|kind<br>`k` |[Kind]|False<br>`all`|The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned|
|base<br>`b` |[string]|False<br>`all`|The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned|
|quote<br>`q` |[string]|False<br>`all`|The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned|
??? info "[Kind](/../../schemas/kind)"
The list of asset kinds that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`PERPETUAL` = 1|the perpetual asset kind|
|`FUTURE` = 2|the future asset kind|
|`CALL` = 3|the call option asset kind|
|`PUT` = 4|the put option asset kind|
@@ -0,0 +1,22 @@
!!! info "[ApiPositionsResponse](/../../schemas/api_positions_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|result<br>`r` |[Positions]|True|The positions matching the request filter|
??? info "[Positions](/../../schemas/positions)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|event_time<br>`et` |string|True|Time at which the event was emitted in unix nanoseconds|
|sub_account_id<br>`sa` |string|True|The sub account ID that participated in the trade|
|instrument<br>`i` |string|True|The instrument being represented|
|size<br>`s` |string|True|The size of the position, expressed in base asset decimal units. Negative for short positions|
|notional<br>`n` |string|True|The notional value of the position, negative for short assets, expressed in quote asset decimal units|
|entry_price<br>`ep` |string|True|The entry price of the position, expressed in `9` decimals<br>Whenever increasing the size of a position, the entry price is updated to the new average entry price<br>`new_entry_price = (old_entry_price * old_size + trade_price * trade_size) / (old_size + trade_size)`|
|exit_price<br>`ep1` |string|True|The exit price of the position, expressed in `9` decimals<br>Whenever decreasing the size of a position, the exit price is updated to the new average exit price<br>`new_exit_price = (old_exit_price * old_exit_trade_size + trade_price * trade_size) / (old_exit_trade_size + trade_size)`|
|mark_price<br>`mp` |string|True|The mark price of the position, expressed in `9` decimals|
|unrealized_pnl<br>`up` |string|True|The unrealized PnL of the position, expressed in quote asset decimal units<br>`unrealized_pnl = (mark_price - entry_price) * size`|
|realized_pnl<br>`rp` |string|True|The realized PnL of the position, expressed in quote asset decimal units<br>`realized_pnl = (exit_price - entry_price) * exit_trade_size`|
|total_pnl<br>`tp` |string|True|The total PnL of the position, expressed in quote asset decimal units<br>`total_pnl = realized_pnl + unrealized_pnl`|
|roi<br>`r` |string|True|The ROI of the position, expressed as a percentage<br>`roi = (total_pnl / (entry_price * abs(size))) * 100^`|
|quote_index_price<br>`qi` |string|True|The index price of the quote currency. (reported in `USD`)|
|est_liquidation_price<br>`el` |string|True|The estimated liquidation price|
|leverage<br>`l` |string|True|The current leverage value for this position|
@@ -0,0 +1,42 @@
!!! info "[ApiPreDepositCheckRequest](/../../schemas/api_pre_deposit_check_request)"
UI only for bridge deposits through non native bridge. Currently only supports XY Finance bridge account.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|currency<br>`c` |Currency|True|The currency you hold the deposit in|
|bridge<br>`b` |BridgeType|True|The bridge type to conduct checks for|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
??? info "[BridgeType](/../../schemas/bridge_type)"
|Value| Description |
|-|-|
|`XY` = 1|XY Bridge type|
@@ -0,0 +1,36 @@
!!! info "[ApiPreDepositCheckResponse](/../../schemas/api_pre_deposit_check_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|max_deposit_limit<br>`md` |string|True|Max Deposit Limit reported for the Bridge Account reported in the currency balance|
|currency<br>`c` |Currency|True|The currency you hold the deposit in|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
@@ -0,0 +1,150 @@
!!! info "[ApiPreOrderCheckRequest](/../../schemas/api_pre_order_check_request)"
Get pre-order check information for a new order<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|True|The subaccount ID of orders to query|
|orders<br>`o` |[Order]|True|The order to do pre-order check|
??? info "[Order](/../../schemas/order)"
Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.<br>GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.<br>This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.<br>Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.<br><br>All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.<br>This minimizes the amount of trust users have to offer to GRVT<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|order_id<br>`oi` |string|False<br>`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend|
|sub_account_id<br>`sa` |string|True|The subaccount initiating the order|
|is_market<br>`im` |boolean|False<br>`false`|If the order is a market order<br>Market Orders do not have a limit price, and are always executed according to the maker order price.<br>Market Orders must always be taker orders|
|time_in_force<br>`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:<ul><br><li>PARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg</li><br><li>FULL EXECUTION = AON / FOK - only allows full size execution on all legs</li><br><li>TAKER ONLY = IOC / FOK - only allows taker orders</li><br><li>MAKER OR TAKER = GTT / AON - allows maker or taker orders</li><br></ul>Exchange only supports (GTT, IOC, FOK)<br>RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)|
|post_only<br>`po` |boolean|False<br>`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.<br>If False, Order can be either a maker or taker order. <b>In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.</b><br><br>| | Must Fill All | Can Fill Partial |<br>| - | - | - |<br>| Must Be Taker | FOK + False | IOC + False |<br>| Can Be Either | AON + False | GTC + False |<br>| Must Be Maker | AON + True | GTC + True |<br>|
|reduce_only<br>`ro` |boolean|False<br>`false`|If True, Order must reduce the position size, or be cancelled|
|legs<br>`l` |[OrderLeg]|True|The legs present in this order<br>The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice|
|signature<br>`s` |Signature|True|The signature approving this order|
|metadata<br>`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client|
|state<br>`s1` |OrderState|False<br>`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client|
??? info "[TimeInForce](/../../schemas/time_in_force)"
| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Fill Immediately | FOK | IOC |
| Can Fill Till Time | AON | GTC |
<br>
|Value| Description |
|-|-|
|`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired|
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|instrument<br>`i` |string|True|The instrument to trade in this leg|
|size<br>`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.|
|limit_price<br>`lp` |string|False<br>`0`|The limit price of the order leg, expressed in `9` decimals.<br>This is the number of quote currency units to pay/receive for this leg.<br>This should be `null/0` if the order is a market order|
|is_buying_asset<br>`ib` |boolean|True|Specifies if the order leg is a buy or sell|
??? info "[Signature](/../../schemas/signature)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|signer<br>`s` |string|True|The address (public key) of the wallet signing the payload|
|r<br>`r` |string|True|Signature R|
|s<br>`s1` |string|True|Signature S|
|v<br>`v` |integer|True|Signature V|
|expiration<br>`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
|nonce<br>`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.<br>ie. You can send the same exact instruction twice with different nonces.<br>When the same nonce is used, the same payload will generate the same signature.<br>Our system will consider the payload a duplicate, and ignore it.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.<br>Hence, fields in here are never signed, and is never transmitted to the smart contract.<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|client_order_id<br>`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client<br>This is used to identify the order in the client's system<br>This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer<br>This field will not be propagated to the smart contract, and should not be signed by the client<br>This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected<br>Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]<br>To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]<br><br>When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|create_time<br>`ct` |string|False<br>`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds|
|trigger<br>`t` |TriggerOrderMetadata|False<br>``|Trigger fields are used to support any type of trigger order such as TP/SL|
|broker<br>`b` |BrokerTag|False<br>``|Specifies the broker who brokered the order|
??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)"
Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).<br><br>Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_type<br>`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc|
|tpsl<br>`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>|
??? info "[TriggerType](/../../schemas/trigger_type)"
Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.<br><br>Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.|
|`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.|
|`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.|
??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)"
Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.<br><br>### Fields:<br>- **triggerBy**: Defines the price type that activates the order (e.g., index price).<br>- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.<br><br><br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trigger_by<br>`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price<br>`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.<br><br>Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.<br><br><br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|no trigger condition|
|`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price|
|`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price|
??? info "[BrokerTag](/../../schemas/broker_tag)"
BrokerTag is a tag for the broker that the order is sent from.<br>
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0||
|`COIN_ROUTES` = 1|CoinRoutes|
|`ALERTATRON` = 2|Alertatron|
|`ORIGAMI` = 3|Origami|
??? info "[OrderState](/../../schemas/order_state)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|status<br>`s` |OrderStatus|True|The status of the order|
|reject_reason<br>`rr` |OrderRejectReason|True|The reason for rejection or cancellation|
|book_size<br>`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs|
|traded_size<br>`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs|
|update_time<br>`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds|
|avg_fill_price<br>`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs|
??? info "[OrderStatus](/../../schemas/order_status)"
|Value| Description |
|-|-|
|`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.|
|`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.|
|`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.|
|`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.|
|`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.|
??? info "[OrderRejectReason](/../../schemas/order_reject_reason)"
|Value| Description |
|-|-|
|`UNSPECIFIED` = 0|order is not cancelled or rejected|
|`CLIENT_CANCEL` = 1|client called a Cancel API|
|`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API|
|`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'|
|`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons|
|`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill|
|`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched|
|`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched|
|`EXPIRED` = 8|the order was cancelled as it has expired|
|`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook|
|`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase|
|`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger|
|`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger|
|`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account|
|`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId|
|`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement|
|`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)|
|`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity|
|`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)|
|`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state|
|`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action|
|`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired|
|`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist|
|`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission|
|`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value|
|`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue|
|`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size|
|`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future|
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
@@ -0,0 +1,49 @@
!!! info "[ApiPreOrderCheckResponse](/../../schemas/api_pre_order_check_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|results<br>`r` |[PreOrderCheckResult]|True|Pre order check for each new order in the request|
??? info "[PreOrderCheckResult](/../../schemas/pre_order_check_result)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|max_qty<br>`mq` |[AssetMaxQty]|True|The maximum quantity for each leg|
|margin_required<br>`mr` |string|True|The margin required for the order (reported in `settle_currency`)|
|order_valid<br>`ov` |boolean|True|Whether the order is valid|
|reason<br>`r` |string|True|The reason the order is invalid, if any|
|settle_currency<br>`sc` |Currency|True|The subAccount settle currency|
??? info "[AssetMaxQty](/../../schemas/asset_max_qty)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|asset<br>`a` |string|True|The asset associated with the max quantity|
|max_buy_qty<br>`mb` |string|True|The maximum buy quantity|
|max_sell_qty<br>`ms` |string|True|The maximum sell quantity|
??? info "[Currency](/../../schemas/currency)"
The list of Currencies that are supported on the GRVT exchange<br>
|Value| Description |
|-|-|
|`USD` = 1|the USD fiat currency|
|`USDC` = 2|the USDC token|
|`USDT` = 3|the USDT token|
|`ETH` = 4|the ETH token|
|`BTC` = 5|the BTC token|
|`SOL` = 6|the SOL token|
|`ARB` = 7|the ARB token|
|`BNB` = 8|the BNB token|
|`ZK` = 9|the ZK token|
|`POL` = 10|the POL token|
|`OP` = 11|the OP token|
|`ATOM` = 12|the ATOM token|
|`KPEPE` = 13|the 1000PEPE token|
|`TON` = 14|the TON token|
|`XRP` = 15|the XRP token|
|`TRUMP` = 20|the TRUMP token|
|`SUI` = 21|the SUI token|
|`LINK` = 25|the LINK token|
|`JUP` = 27|the JUP token|
|`FARTCOIN` = 28|the FARTCOIN token|
|`ENA` = 29|the ENA token|
|`DOGE` = 30|the DOGE token|
|`ADA` = 33|the ADA token|
|`AAVE` = 34|the AAVE token|
|`BERA` = 35|the BERA token|
|`IP` = 40|the IP token|
@@ -0,0 +1,6 @@
!!! info "[ApiQueryFlatReferralStatRequest](/../../schemas/api_query_flat_referral_stat_request)"
Query flat referral stats<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|account_id<br>`ai` |string|True|The off chain account id to get referral stats|
@@ -0,0 +1,5 @@
!!! info "[ApiQueryFlatReferralStatResponse](/../../schemas/api_query_flat_referral_stat_response)"
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|direct_invite_count<br>`di` |integer|True|Direct invite count|
|indirect_invite_count<br>`ii` |integer|True|Indirect invite count|
@@ -0,0 +1,7 @@
!!! info "[ApiQueryTradingPerformanceRequest](/../../schemas/api_query_trading_performance_request)"
Request to retrieve the trading volume<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|sub_account_id<br>`sa` |string|False<br>`all`|Optional: The subaccount ID to filter by|
|asset<br>`a` |unknown|True|The asset to filter by|
@@ -0,0 +1,7 @@
!!! info "[ApiQueryTradingPerformanceResponse](/../../schemas/api_query_trading_performance_response)"
Response to retrieve the trading volume<br>
|Name<br>`Lite`|Type|Required<br>`Default`| Description |
|-|-|-|-|
|trading_volume<br>`tv` |string|True|Trading volume in USDT|
|realized_pnl<br>`rp` |string|True|Realized PnL in USDT|

Some files were not shown because too many files have changed in this diff Show More