From 5d40a9220a86b7f0469a61abdc2eb0736c34e05a Mon Sep 17 00:00:00 2001 From: Kamil Molendys <1657091+ilkamo@users.noreply.github.com> Date: Sun, 7 Jul 2024 11:36:37 +0200 Subject: [PATCH 1/2] feat: added PreferLiquidDexes to openapi --- jupiter/client.gen.go | 22 ++++++++++++++++++++++ jupiter/openapi/jupiter-swagger.yaml | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/jupiter/client.gen.go b/jupiter/client.gen.go index e93309f..2f77437 100644 --- a/jupiter/client.gen.go +++ b/jupiter/client.gen.go @@ -237,6 +237,9 @@ type OutputMintParameter = string // PlatformFeeBpsParameter defines model for PlatformFeeBpsParameter. type PlatformFeeBpsParameter = int +// PreferLiquidDexes defines model for PreferLiquidDexes. +type PreferLiquidDexes = bool + // RestrictIntermediateTokensParameter defines model for RestrictIntermediateTokensParameter. type RestrictIntermediateTokensParameter = bool @@ -304,6 +307,9 @@ type GetQuoteParams struct { // MinimizeSlippage Default is false. Miminize slippage attempts to find routes with lower slippage. MinimizeSlippage *MinimizeSlippage `form:"minimizeSlippage,omitempty" json:"minimizeSlippage,omitempty"` + + // PreferLiquidDexes Default is false. Enabling it would only consider markets with high liquidity to reduce slippage. + PreferLiquidDexes *PreferLiquidDexes `form:"preferLiquidDexes,omitempty" json:"preferLiquidDexes,omitempty"` } // GetQuoteParamsSwapMode defines parameters for GetQuote. @@ -989,6 +995,22 @@ func NewGetQuoteRequest(server string, params *GetQuoteParams) (*http.Request, e } + if params.PreferLiquidDexes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "preferLiquidDexes", runtime.ParamLocationQuery, *params.PreferLiquidDexes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } diff --git a/jupiter/openapi/jupiter-swagger.yaml b/jupiter/openapi/jupiter-swagger.yaml index e98b8ad..9dd265d 100644 --- a/jupiter/openapi/jupiter-swagger.yaml +++ b/jupiter/openapi/jupiter-swagger.yaml @@ -41,6 +41,7 @@ paths: - $ref: '#/components/parameters/PlatformFeeBpsParameter' - $ref: '#/components/parameters/MaxAccountsParameter' - $ref: '#/components/parameters/MinimizeSlippage' + - $ref: '#/components/parameters/PreferLiquidDexes' responses: '200': description: Successful response @@ -499,3 +500,9 @@ components: in: query schema: type: boolean + PreferLiquidDexes: + name: preferLiquidDexes + description: Default is false. Enabling it would only consider markets with high liquidity to reduce slippage. + in: query + schema: + type: boolean \ No newline at end of file From 9de0b78397893f78dda3a26704ba3bfff66a1da7 Mon Sep 17 00:00:00 2001 From: Kamil Molendys <1657091+ilkamo@users.noreply.github.com> Date: Sun, 7 Jul 2024 11:37:23 +0200 Subject: [PATCH 2/2] new line --- jupiter/openapi/jupiter-swagger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jupiter/openapi/jupiter-swagger.yaml b/jupiter/openapi/jupiter-swagger.yaml index 9dd265d..83f4345 100644 --- a/jupiter/openapi/jupiter-swagger.yaml +++ b/jupiter/openapi/jupiter-swagger.yaml @@ -505,4 +505,4 @@ components: description: Default is false. Enabling it would only consider markets with high liquidity to reduce slippage. in: query schema: - type: boolean \ No newline at end of file + type: boolean