diff --git a/README.md b/README.md index 87f2d47..79e4fa2 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,12 @@ Run the following command at the root of your documentation (where docs.json is) mint dev ``` +Alternatively, you can run the development server without installing the CLI globally: + +``` +npx mintlify dev +``` + #### Troubleshooting - If the dev environment isn't running - Run `mint update` to ensure you have the most recent version of the CLI. diff --git a/api-reference/endpoint/insights/competitors.mdx b/api-reference/endpoint/insights/competitors.mdx new file mode 100644 index 0000000..73e75a1 --- /dev/null +++ b/api-reference/endpoint/insights/competitors.mdx @@ -0,0 +1,7 @@ +--- +title: "Competitors" +openapi: "GET /competitors/{id}" +version: 1.0 +--- + +Get the time taken and fees for the given order from the competitors. diff --git a/api-reference/endpoint/insights/get-volume-metrics.mdx b/api-reference/endpoint/insights/get-volume-metrics.mdx new file mode 100644 index 0000000..abb072c --- /dev/null +++ b/api-reference/endpoint/insights/get-volume-metrics.mdx @@ -0,0 +1,7 @@ +--- +title: "Volume Metrics" +openapi: "GET /volume-metrics" +version: 1.0 +--- + +Get the volume metrics. diff --git a/api-reference/endpoint/insights/get-volume.mdx b/api-reference/endpoint/insights/get-volume.mdx new file mode 100644 index 0000000..58a45c9 --- /dev/null +++ b/api-reference/endpoint/insights/get-volume.mdx @@ -0,0 +1,7 @@ +--- +title: "Volume" +openapi: "GET /volume-2" +version: 1.0 +--- + +Get the volume of swaps for a given asset. diff --git a/api-reference/openapi.json b/api-reference/openapi.json index 1c2a91d..c5258bb 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -49,11 +49,7 @@ "TokenSchemaName": { "type": "string", "title": "token", - "enum": [ - "evm:erc20", - "solana:spltoken", - "starknet:erc20" - ] + "enum": ["evm:erc20", "solana:spltoken", "starknet:erc20"] }, "SchemaName": { "oneOf": [ @@ -98,13 +94,13 @@ }, "ChainWithAssets": { "allOf": [ - {"$ref": "#/components/schemas/ChainVerbose"}, + { "$ref": "#/components/schemas/ChainVerbose" }, { "type": "object", "properties": { "assets": { "type": "array", - "items": {"$ref": "#/components/schemas/AssetVerbose"} + "items": { "$ref": "#/components/schemas/AssetVerbose" } } } } @@ -131,11 +127,11 @@ }, "supported_htlc_schemas": { "type": "array", - "items": {"$ref": "#/components/schemas/HTLCSchemaName"} + "items": { "$ref": "#/components/schemas/HTLCSchemaName" } }, "supported_token_schemas": { "type": "array", - "items": {"$ref": "#/components/schemas/TokenSchemaName"} + "items": { "$ref": "#/components/schemas/TokenSchemaName" } } } }, @@ -156,10 +152,7 @@ { "type": "string", "title": "testnet", - "enum": [ - "ethereum_sepolia:wbtc", - "ethereum_sepolia:usdc" - ] + "enum": ["ethereum_sepolia:wbtc", "ethereum_sepolia:usdc"] } ] }, @@ -182,22 +175,16 @@ "$ref": "#/components/schemas/EVMTransaction" } }, - "required": [ - "total_earnings", - "affiliate", - "asset" - ] + "required": ["total_earnings", "affiliate", "asset"] }, "AffiliateFeesResponse": { - "allOf": [ + "allOf": [ { "$ref": "#/components/schemas/Response" }, { "type": "object", - "required": [ - "result" - ], + "required": ["result"], "properties": { "result": { "type": "array", @@ -259,12 +246,12 @@ ] }, "Contract": { - "type": "object", - "properties": { - "address": { "type": "string" }, - "schema": { "$ref": "#/components/schemas/SchemaName" } - }, - "nullable": true + "type": "object", + "properties": { + "address": { "type": "string" }, + "schema": { "$ref": "#/components/schemas/SchemaName" } + }, + "nullable": true }, "AssetVerbose": { "type": "object", @@ -490,7 +477,7 @@ "items": { "$ref": "#/components/schemas/Liquidity" } - }, + }, "policy": { "$ref": "#/components/schemas/RoutePolicy" } } }, @@ -498,9 +485,13 @@ "type": "object", "required": [], "properties": { - "address": {"type": "string"}, - "asset": {"$ref": "#/components/schemas/AffiliateFeeAsset"}, - "fee": {"type": "integer", "description": "In BIPS (base index points) 100 bips = 1%", "example": 10 } + "address": { "type": "string" }, + "asset": { "$ref": "#/components/schemas/AffiliateFeeAsset" }, + "fee": { + "type": "integer", + "description": "In BIPS (base index points) 100 bips = 1%", + "example": 10 + } } }, "OrderRequest": { @@ -541,9 +532,7 @@ "type": "string" } }, - "required": [ - "signature" - ] + "required": ["signature"] }, "RedeemActionRequest": { "type": "object", @@ -553,9 +542,7 @@ "type": "string" } }, - "required": [ - "secret" - ] + "required": ["secret"] }, "RefundActionRequest": { "type": "object", @@ -570,9 +557,7 @@ "type": "string" } }, - "required": [ - "signature" - ] + "required": ["signature"] }, "PaginatedOrders": { "type": "object", @@ -602,10 +587,7 @@ "properties": { "status": { "type": "string", - "enum": [ - "Ok", - "Error" - ] + "enum": ["Ok", "Error"] }, "error": { "type": "string", @@ -623,11 +605,7 @@ }, "BitcoinInitiateRequest": { "type": "object", - "required": [ - "order_id", - "to", - "amount" - ], + "required": ["order_id", "to", "amount"], "properties": { "order_id": { "type": "string" @@ -718,11 +696,7 @@ }, "EVMInitiateRequest": { "type": "object", - "required": [ - "order_id", - "transaction", - "typed_data" - ], + "required": ["order_id", "transaction", "typed_data"], "properties": { "order_id": { "type": "string" @@ -737,7 +711,7 @@ "typed_data": { "$ref": "#/components/schemas/EVMTypedData" } - } + } }, "StarknetTransaction": { "type": "object", @@ -746,8 +720,14 @@ "type": "array", "items": { "type": "string" } }, - "selector": { "type": "string", "example": "0x2aed25fcd0101fcece997d93f9d0643dfa3fbd4118cae16bf7d6cd533577c28" }, - "to": { "type": "string", "example": "0x2448040b22b27f5a814756e67da005701e525658b162d4f0343d2e011bc6dad" } + "selector": { + "type": "string", + "example": "0x2aed25fcd0101fcece997d93f9d0643dfa3fbd4118cae16bf7d6cd533577c28" + }, + "to": { + "type": "string", + "example": "0x2448040b22b27f5a814756e67da005701e525658b162d4f0343d2e011bc6dad" + } } }, "StarknetTypedData": { @@ -799,7 +779,10 @@ "items": { "type": "integer" }, - "example": [1208377717, 3328794282, 2017733490, 901540904, 1502396360, 718117041, 1704147999, 3475506811] + "example": [ + 1208377717, 3328794282, 2017733490, 901540904, 1502396360, + 718117041, 1704147999, 3475506811 + ] }, "timelock": { "type": "string", @@ -848,11 +831,7 @@ }, "StarknetInitiateRequest": { "type": "object", - "required": [ - "order_id", - "transaction", - "typed_data" - ], + "required": ["order_id", "transaction", "typed_data"], "properties": { "order_id": { "type": "string" @@ -868,14 +847,11 @@ "typed_data": { "$ref": "#/components/schemas/StarknetTypedData" } - } + } }, "SolanaInitiateRequest": { "type": "object", - "required": [ - "order_id", - "versioned_tx" - ], + "required": ["order_id", "versioned_tx"], "properties": { "order_id": { "type": "string" @@ -910,7 +886,11 @@ "properties": { "asset": { "$ref": "#/components/schemas/Asset" }, "amount": { "type": "string", "example": "1000000" }, - "display": { "type": "string", "example": "0.01", "description": "USD Value" }, + "display": { + "type": "string", + "example": "0.01", + "description": "USD Value" + }, "value": { "type": "string", "example": "100" } } }, @@ -926,7 +906,10 @@ "type": "object", "properties": { "solver_id": { "type": "string" }, - "liquidity": { "type": "array", "items": { "$ref": "#/components/schemas/Liquidity" } } + "liquidity": { + "type": "array", + "items": { "$ref": "#/components/schemas/Liquidity" } + } } }, "CreateOrderResponse": { @@ -1010,7 +993,7 @@ } ] }, - "Schema": { + "Schema": { "type": "object", "properties": { "name": { "$ref": "#/components/schemas/SchemaName" }, @@ -1038,7 +1021,10 @@ { "type": "object", "properties": { - "result": { "type": "array", "items": { "$ref": "#/components/schemas/Schema"} } + "result": { + "type": "array", + "items": { "$ref": "#/components/schemas/Schema" } + } } } ] @@ -1101,9 +1087,7 @@ }, { "type": "object", - "required": [ - "result" - ], + "required": ["result"], "properties": { "result": { "$ref": "#/components/schemas/Order" @@ -1119,9 +1103,7 @@ }, { "type": "object", - "required": [ - "result" - ], + "required": ["result"], "properties": { "result": { "type": "string" @@ -1180,6 +1162,144 @@ } } ] + }, + "VolumeMetricsResponse": { + "allOf": [ + { + "$ref": "#/components/schemas/Response" + }, + { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "type": "object", + "properties": { + "source_volume": { + "type": "string", + "description": "Source volume amount in USD", + "format": "decimal" + }, + "destination_volume": { + "type": "string", + "description": "Destination volume amount in USD", + "format": "decimal" + }, + "total_volume": { + "type": "string", + "description": "Total volume amount in USD", + "format": "decimal" + }, + "source_chain": { + "type": "string", + "description": "Source blockchain identifier", + "nullable": true + }, + "dest_chain": { + "type": "string", + "description": "Destination blockchain identifier", + "nullable": true + }, + "swaps_count": { + "type": "string", + "description": "Number of swaps", + "format": "decimal" + } + } + } + } + } + } + ] + }, + "CompetitorsResponse": { + "allOf": [ + { + "$ref": "#/components/schemas/Response" + }, + { + "type": "object", + "properties": { + "result": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "Unique identifier for the order" + }, + "garden": { + "type": "object", + "properties": { + "duration": { + "type": "integer", + "description": "Duration in seconds" + }, + "fees": { + "type": "string", + "description": "Fees in USD" + } + }, + "required": ["duration", "fees"] + }, + "competitors": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "duration": { + "type": "integer", + "description": "Duration in seconds" + }, + "fees": { + "type": "string", + "description": "Fees in USD" + } + }, + "required": ["duration", "fees"] + }, + "description": "Dynamic object where keys are competitor names and values contain duration and fees", + "example": { + "competitor-name-1": { + "duration": "225", + "fees": "4.00" + }, + "competitor-name-2": { + "duration": "182", + "fees": "3.00" + } + } + }, + "meta": { + "type": "object", + "properties": { + "units": { + "type": "object", + "properties": { + "duration": { + "description": "Unit for duration (seconds)" + }, + "fees": { + "description": "Unit for fees (USD)" + } + }, + "required": ["duration", "fees"] + } + }, + "example": { + "units": { + "duration": "seconds", + "fees": "USD" + } + }, + "required": ["units"] + } + }, + "required": ["orderId", "garden", "competitors", "meta"] + } + } + } + ] } } }, @@ -1560,9 +1680,7 @@ }, "patch": { "summary": "Update swap by doing an action.", - "tags": [ - "Swaps" - ], + "tags": ["Swaps"], "parameters": [ { "in": "path", @@ -1578,12 +1696,7 @@ "required": true, "schema": { "type": "string", - "enum": [ - "initiate", - "redeem", - "refund", - "instant-refund" - ] + "enum": ["initiate", "redeem", "refund", "instant-refund"] } } ], @@ -1792,12 +1905,8 @@ "status": "Ok", "result": { "default": "open", - "isolation_groups": [ - "ethereum:SEED <-> arbitrum:SEED" - ], - "blacklist_pairs": [ - "bitcoin:BTC -> starknet:*" - ], + "isolation_groups": ["ethereum:SEED <-> arbitrum:SEED"], + "blacklist_pairs": ["bitcoin:BTC -> starknet:*"], "whitelist_overrides": [] } } @@ -1806,6 +1915,130 @@ } } } + }, + "/volume-metrics": { + "get": { + "summary": "Get detailed volume metrics and analytics.", + "security": [], + "description": "Returns comprehensive volume data including historical trends, chain-specific breakdowns, and asset pair analytics.", + "responses": { + "200": { + "description": "Detailed volume metrics and analytics data.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VolumeMetricsResponse" + } + } + } + } + } + } + }, + "/volume-2": { + "get": { + "security": [], + "summary": "Get swap volume.", + "parameters": [ + { + "in": "query", + "name": "address", + "required": false, + "schema": { + "type": "string" + }, + "description": "Filter by wallet address" + }, + { + "in": "query", + "name": "source_chain", + "required": false, + "schema": { + "type": "string" + }, + "description": "Filter by source chain" + }, + { + "in": "query", + "name": "dest_chain", + "required": false, + "schema": { + "type": "string" + }, + "description": "Filter by destination chain" + }, + { + "in": "query", + "name": "from", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Filter by timestamp in Unix timestamp format" + }, + { + "in": "query", + "name": "to", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Filter by timestamp in Unix timestamp format" + }, + { + "in": "query", + "name": "chain", + "required": false, + "schema": { + "type": "string" + }, + "description": "Filter by chain" + } + ], + "responses": { + "200": { + "description": "Total swap volume.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResponseString" + } + } + } + } + } + } + }, + "/competitors/{id}": { + "get": { + "security": [], + "summary": "Get competitors.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Order ID" + } + ], + "responses": { + "200": { + "description": "Competitors.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompetitorsResponse" + } + } + } + } + } + } } } -} \ No newline at end of file +} diff --git a/docs.json b/docs.json index 99081b7..87dfbe8 100644 --- a/docs.json +++ b/docs.json @@ -10,20 +10,13 @@ "favicon": "/favicon.svg", "openapi": "api-reference/openapi.json", "contextual": { - "options": [ - "copy", - "view", - "chatgpt", - "claude" - ] + "options": ["copy", "view", "chatgpt", "claude"] }, "navigation": { "tabs": [ { "tab": "Home", - "pages": [ - "index" - ] + "pages": ["index"] }, { "tab": "Get Started", @@ -100,10 +93,7 @@ }, { "group": "API", - "pages": [ - "developers/api/overview", - "developers/api/1click" - ] + "pages": ["developers/api/overview", "developers/api/1click"] }, { "group": "SDK", @@ -134,16 +124,11 @@ }, { "group": "Developer Guides", - "pages": [ - "developers/guides/cookbook", - "developers/guides/sdk" - ] + "pages": ["developers/guides/cookbook", "developers/guides/sdk"] }, { "group": "Testing", - "pages": [ - "developers/localnet" - ] + "pages": ["developers/localnet"] } ] }, @@ -152,9 +137,7 @@ "groups": [ { "group": "Get Started", - "pages": [ - "contracts/overview" - ] + "pages": ["contracts/overview"] }, { "group": "Contracts", @@ -173,9 +156,7 @@ "groups": [ { "group": "Get Started", - "pages": [ - "api-reference/quickstart" - ] + "pages": ["api-reference/quickstart"] }, { "group": "Global", @@ -206,14 +187,20 @@ "api-reference/endpoint/orders/get-instant-refund-hash", "api-reference/endpoint/orders/patch" ] + }, + { + "group": "Insights", + "pages": [ + "api-reference/endpoint/insights/get-volume", + "api-reference/endpoint/insights/get-volume-metrics", + "api-reference/endpoint/insights/competitors" + ] } ] }, { "tab": "Changelog", - "pages": [ - "changelog" - ] + "pages": ["changelog"] } ], "global": { @@ -296,4 +283,4 @@ } ] } -} \ No newline at end of file +}