From 5e73e853ca2b7b86d259adb90e5f7c1797312a35 Mon Sep 17 00:00:00 2001 From: Kirill Litvinov Date: Fri, 19 Apr 2024 17:07:44 +0300 Subject: [PATCH] auto slippage --- package.json | 2 +- src/services/Aggregator/schemas/swapInfoSchema.ts | 1 + src/services/Aggregator/ws/index.ts | 1 + src/services/Aggregator/ws/schemas/swapInfoSchema.ts | 1 + src/types.ts | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b51774..e643eea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.20.83", + "version": "0.20.84-rc1", "description": "Orion Protocol SDK", "main": "./lib/index.cjs", "module": "./lib/index.js", diff --git a/src/services/Aggregator/schemas/swapInfoSchema.ts b/src/services/Aggregator/schemas/swapInfoSchema.ts index ecbd440..aed6d09 100644 --- a/src/services/Aggregator/schemas/swapInfoSchema.ts +++ b/src/services/Aggregator/schemas/swapInfoSchema.ts @@ -49,6 +49,7 @@ const swapInfoBase = z.object({ mi: z.number().optional(), // market amount in, USD d: z.string().optional(), // difference in available amount in/out (USD) and market amount out/in (USD) in percentage }).optional(), + autoSlippage: z.number().optional(), }); const swapInfoByAmountIn = swapInfoBase.extend({ diff --git a/src/services/Aggregator/ws/index.ts b/src/services/Aggregator/ws/index.ts index f0f0e8f..fb1f88a 100644 --- a/src/services/Aggregator/ws/index.ts +++ b/src/services/Aggregator/ws/index.ts @@ -541,6 +541,7 @@ class AggregatorWS { marketAmountIn: json.usd.mi, difference: json.usd.d, }, + autoSlippage: json.sl, }; switch (json.k) { // kind diff --git a/src/services/Aggregator/ws/schemas/swapInfoSchema.ts b/src/services/Aggregator/ws/schemas/swapInfoSchema.ts index 3c8a5d4..eb23200 100644 --- a/src/services/Aggregator/ws/schemas/swapInfoSchema.ts +++ b/src/services/Aggregator/ws/schemas/swapInfoSchema.ts @@ -48,6 +48,7 @@ const swapInfoSchemaBase = baseMessageSchema.extend({ mi: z.number().optional(), // market amount in, USD d: z.string().optional(), // difference in available amount in/out (USD) and market amount out/in (USD) in percentage }).optional(), + sl: z.number().optional(), }); const swapInfoSchemaByAmountIn = swapInfoSchemaBase.extend({ diff --git a/src/types.ts b/src/types.ts index eacf494..6a3513a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -210,6 +210,7 @@ export type SwapInfoBase = { marketAmountIn: number | undefined difference: string | undefined } | undefined + autoSlippage: number | undefined } export type SwapInfoByAmountIn = SwapInfoBase & {