Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support minimize slippage #15

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 120 additions & 6 deletions jupiter/client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions jupiter/openapi/jupiter-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ paths:
- $ref: '#/components/parameters/OutputMintParameter'
- $ref: '#/components/parameters/AmountParameter'
- $ref: '#/components/parameters/SlippageParameter'
- $ref: '#/components/parameters/AutoSlippageParameter'
- $ref: '#/components/parameters/AutoSlippageCollisionValueParameter'
- $ref: '#/components/parameters/ComputeAutoSlippageParameter'
- $ref: '#/components/parameters/MaxAutoSlippageBpsParameter'
- $ref: '#/components/parameters/SwapModeParameter'
- $ref: '#/components/parameters/DexesParameter'
- $ref: '#/components/parameters/ExcludeDexesParameter'
Expand All @@ -36,6 +40,7 @@ paths:
- $ref: '#/components/parameters/AsLegacyTransactionParameter'
- $ref: '#/components/parameters/PlatformFeeBpsParameter'
- $ref: '#/components/parameters/MaxAccountsParameter'
- $ref: '#/components/parameters/MinimizeSlippage'
responses:
'200':
description: Successful response
Expand Down Expand Up @@ -183,6 +188,9 @@ components:
slippageBps:
type: integer
format: int32
computedAutoSlippage:
type: integer
format: int32
platformFee:
$ref: '#/components/schemas/PlatformFee'
priceImpactPct:
Expand Down Expand Up @@ -300,6 +308,9 @@ components:
skipUserAccountsRpcCalls:
description: When enabled, it will not do any rpc calls check on user's accounts. Enable it only when you already setup all the accounts needed for the trasaction, like wrapping or unwrapping sol, destination account is already created.
type: boolean
programAuthorityId:
description: The program authority id [0;7], load balanced across the available set by default
type: integer
quoteResponse:
$ref: '#/components/schemas/QuoteResponse'

Expand Down Expand Up @@ -405,6 +416,30 @@ components:
in: query
schema:
type: integer
AutoSlippageParameter:
name: autoSlippage
description: Automatically calculate the slippage based on pairs.
in: query
schema:
type: boolean
AutoSlippageCollisionValueParameter:
name: autoSlippageCollisionUsdValue
description: Automatic slippage collision value.
in: query
schema:
type: integer
MaxAutoSlippageBpsParameter:
name: maxAutoSlippageBps
description: Max slippage in basis points for auto slippage calculation. Default is 400.
in: query
schema:
type: integer
ComputeAutoSlippageParameter:
name: computeAutoSlippage
description: Compute auto slippage value without using it.
in: query
schema:
type: boolean
SwapModeParameter:
name: swapMode
description: (ExactIn or ExactOut) Defaults to ExactIn. ExactOut is for supporting use cases where you need an exact token amount, like payments. In this case the slippage is on the input token.
Expand Down Expand Up @@ -458,3 +493,9 @@ components:
in: query
schema:
type: integer
MinimizeSlippage:
name: minimizeSlippage
description: Default is false. Miminize slippage attempts to find routes with lower slippage.
in: query
schema:
type: boolean
Loading