Response Schema¶
Each response has been mapped into a pydantic schema in a way that makes it easy to read and write codes that use them.
The classes identifying the response schema of an endpoint are the only ones ending with Response word, all other sub-schemes are used to identify the structures obtained from the responses.
Schema Enhancement
If some schema are incorrect or needs to be enhanced (optional/mandatory fields changes, incorrect datatype or schema update) feel free to open a pull request or issue by attaching:
- method
- endpoint call executed
- response obtained
cyhole.jupiter.schema
¶
JupiterHTTPError
¶
Bases: BaseModel
Jupiter API returns an error schema on failed request that can be used to investigated the error. This schema is used to strandardise the HTTPErrors.
GetPriceDepthValues
¶
Bases: BaseModel
Depth values.
GetPriceDepthRatio
¶
GetPriceDepth
¶
Bases: BaseModel
Depth information.
buy_price_impact_ratio
class-attribute
instance-attribute
¶
buy_price_impact_ratio: GetPriceDepthRatio | None = Field(
default=None, alias="buyPriceImpactRatio"
)
sell_price_impact_ratio
class-attribute
instance-attribute
¶
sell_price_impact_ratio: GetPriceDepthRatio | None = Field(
default=None, alias="sellPriceImpactRatio"
)
GetPriceLastSwappedPrice
¶
Bases: BaseModel
Last swapped price information.
last_jupiter_sell_at_unix
class-attribute
instance-attribute
¶
last_jupiter_sell_at_unix: int = Field(
alias="lastJupiterSellAt"
)
last_jupiter_sell_price
class-attribute
instance-attribute
¶
last_jupiter_sell_price: str = Field(
alias="lastJupiterSellPrice"
)
last_jupiter_buy_at_unix
class-attribute
instance-attribute
¶
last_jupiter_buy_at_unix: int = Field(
alias="lastJupiterBuyAt"
)
last_jupiter_buy_price
class-attribute
instance-attribute
¶
last_jupiter_buy_price: str = Field(
alias="lastJupiterBuyPrice"
)
GetPriceQuotedPrice
¶
GetPriceExtraInfo
¶
Bases: BaseModel
Extra information about the price.
last_swapped_price
class-attribute
instance-attribute
¶
last_swapped_price: GetPriceLastSwappedPrice | None = Field(
default=None, alias="lastSwappedPrice"
)
quoted_price
class-attribute
instance-attribute
¶
quoted_price: GetPriceQuotedPrice = Field(
alias="quotedPrice"
)
confidence_level
class-attribute
instance-attribute
¶
confidence_level: str = Field(alias='confidenceLevel')
GetPriceData
¶
Bases: BaseModel
extra_info
class-attribute
instance-attribute
¶
extra_info: None | GetPriceExtraInfo = Field(
default=None, alias="extraInfo"
)
Extra information about the price. Only available if request param extra_info is set to True.
GetPriceResponse
¶
GetQuoteInput
¶
Bases: BaseModel
Model used to identify the inputs params required by a GET Quote request.
input_token
class-attribute
instance-attribute
¶
input_token: str = Field(serialization_alias='inputMint')
The address of the input token on the chain.
output_token
class-attribute
instance-attribute
¶
output_token: str = Field(serialization_alias='outputMint')
The address of the output token on the chain.
amount
instance-attribute
¶
amount: int
The amount to swap, factoring in the token decimals.
For example, if the token has 6 decimals, then 1.0 = 1_000_000.
slippage_base_points
class-attribute
instance-attribute
¶
slippage_base_points: int = Field(
default=50, serialization_alias="slippageBps"
)
Slippage tolerance in basis points. Observe that if the slippage exeeded this value, then the swap will fail.
swap_mode
class-attribute
instance-attribute
¶
swap_mode: str = Field(
default=JupiterSwapMode.EXACT_IN.value,
serialization_alias="swapMode",
)
Define if the slippage is on the input or output token.
dexes
class-attribute
instance-attribute
¶
dexes: list[str] | None = None
List of DEXes to include; by default, all the DEXes are included.
See JupiterSwapDex for all the supported DEXs
exclude_dexes
class-attribute
instance-attribute
¶
exclude_dexes: list[str] | None = Field(
default=None, serialization_alias="excludeDexes"
)
List of DEXes to exclude.
See JupiterSwapDex for all the supported DEXs
restrict_intermediate_tokens
class-attribute
instance-attribute
¶
restrict_intermediate_tokens: bool | None = Field(
default=None,
serialization_alias="restrictIntermediateTokens",
)
Restrict to a top token set for stable liquidity. This will help to reduce exposure to potential high slippage routes.
only_direct_routes
class-attribute
instance-attribute
¶
only_direct_routes: bool = Field(
default=False, serialization_alias="onlyDirectRoutes"
)
Limit to single hop routes only.
as_legacy_transaction
class-attribute
instance-attribute
¶
as_legacy_transaction: bool = Field(
default=False, serialization_alias="asLegacyTransaction"
)
Use legacy transactions instead of versioned ones.
platform_fee_base_points
class-attribute
instance-attribute
¶
platform_fee_base_points: int | None = Field(
default=None, serialization_alias="platformFeeBps"
)
Fee to charge. The value is in percent and taken from output token.
max_accounts
class-attribute
instance-attribute
¶
max_accounts: int | None = Field(
default=None, serialization_alias="maxAccounts"
)
Max accounts to be used for the quote. Jupiter Frontend uses a maxAccounts of 64.
validator_dexes
classmethod
¶
validator_dexes(dexes: list[str]) -> list[str]
Source code in src/cyhole/jupiter/schema.py
128 129 130 131 132 133 | |
serialize_dexes
classmethod
¶
serialize_dexes(dexes: list[str] | None) -> str | None
Source code in src/cyhole/jupiter/schema.py
135 136 137 138 | |
validator_swap_mode
classmethod
¶
validator_swap_mode(mode: str) -> str
Source code in src/cyhole/jupiter/schema.py
140 141 142 143 144 | |
serialize_flows
classmethod
¶
serialize_flows(value: bool | None) -> str | None
Source code in src/cyhole/jupiter/schema.py
146 147 148 149 150 151 | |
GetQuotePlatformFees
¶
GetQuoteSwapInfo
¶
Bases: BaseModel
amm_label
class-attribute
instance-attribute
¶
amm_label: str | None = Field(default=None, alias='label')
GetQuoteRoutePlan
¶
GetQuoteResponse
¶
Bases: BaseModel
Model used to represent the Quote endpoint from Jupiter API.
other_amount_threshold
class-attribute
instance-attribute
¶
other_amount_threshold: str = Field(
alias="otherAmountThreshold"
)
slippage_base_points
class-attribute
instance-attribute
¶
slippage_base_points: int = Field(alias='slippageBps')
platform_fees
class-attribute
instance-attribute
¶
platform_fees: GetQuotePlatformFees | None = Field(
default=None, alias="platformFee"
)
price_impact_pct
class-attribute
instance-attribute
¶
price_impact_pct: str = Field(alias='priceImpactPct')
route_plan
class-attribute
instance-attribute
¶
route_plan: list[GetQuoteRoutePlan] = Field(
alias="routePlan"
)
GetQuoteTokensResponse
¶
Bases: BaseModel
Model used to represent the Quote/Token endpoint from Jupiter API.
GetQuoteProgramIdLabelResponse
¶
Bases: BaseModel
Model used to represent the Quote/Program ID to Label endpoint from Jupiter API.
PostSwapBody
¶
Bases: BaseModel
Model used to identify the body required by a POST Swap request.
user_public_key
class-attribute
instance-attribute
¶
user_public_key: str = Field(
serialization_alias="userPublicKey"
)
wrap_unwrap_sol
class-attribute
instance-attribute
¶
wrap_unwrap_sol: bool = Field(
default=None, serialization_alias="wrapAndUnwrapSol"
)
use_shared_accounts
class-attribute
instance-attribute
¶
use_shared_accounts: bool = Field(
default=None, serialization_alias="useSharedAccounts"
)
fee_account
class-attribute
instance-attribute
¶
fee_account: str = Field(
default=None, serialization_alias="feeAccount"
)
tracking_account
class-attribute
instance-attribute
¶
tracking_account: str = Field(
default=None, serialization_alias="trackingAccount"
)
compute_unit_price_micro_lamports
class-attribute
instance-attribute
¶
compute_unit_price_micro_lamports: int = Field(
default=None,
serialization_alias="computeUnitPriceMicroLamports",
)
prioritization_fee_lamports
class-attribute
instance-attribute
¶
prioritization_fee_lamports: int = Field(
default=None,
serialization_alias="prioritizationFeeLamports",
)
as_legacy_transaction
class-attribute
instance-attribute
¶
as_legacy_transaction: bool = Field(
default=None, serialization_alias="asLegacyTransaction"
)
use_token_ledger
class-attribute
instance-attribute
¶
use_token_ledger: bool = Field(
default=None, serialization_alias="useTokenLedger"
)
destination_token_account
class-attribute
instance-attribute
¶
destination_token_account: str = Field(
default=None,
serialization_alias="destinationTokenAccount",
)
dynamic_compute_unit_limit
class-attribute
instance-attribute
¶
dynamic_compute_unit_limit: bool = Field(
default=None,
serialization_alias="dynamicComputeUnitLimit",
)
skip_user_accounts_rpc_calls
class-attribute
instance-attribute
¶
skip_user_accounts_rpc_calls: bool = Field(
default=None,
serialization_alias="skipUserAccountsRpcCalls",
)
quote_response
class-attribute
instance-attribute
¶
quote_response: GetQuoteResponse = Field(
serialization_alias="quoteResponse"
)
PostSwapResponse
¶
Bases: BaseModel
swap_transaction
class-attribute
instance-attribute
¶
swap_transaction: str = Field(alias='swapTransaction')
last_valid_block_height
class-attribute
instance-attribute
¶
last_valid_block_height: int = Field(
alias="lastValidBlockHeight"
)
prioritization_fee_lamports
class-attribute
instance-attribute
¶
prioritization_fee_lamports: int = Field(
default=0, alias="prioritizationFeeLamports"
)
GetTokenInfoResponse
¶
Bases: BaseModel
Model used to represent the Token endpoint from Jupiter API focused on retrieving information about a token.
GetTokenMarketMintsResponse
¶
Bases: BaseModel
Model used to represent the Token Market Mints endpoint from Jupiter API.
GetTokenTaggedToken
¶
Bases: GetTokenInfoResponse
GetTokenTaggedResponse
¶
Bases: BaseModel
Model used to represent the Token Tagged endpoint from Jupiter API.
GetTokenNewToken
¶
Bases: BaseModel
Model used to represent a token information on the Token New endpoint.
GetTokenNewResponse
¶
Bases: BaseModel
Model used to represent the Token New endpoint from Jupiter API.
PostLimitOrderCreateBody
¶
Bases: BaseModel
Model used to identify the body required by a POST Limit Order Create request.
user_public_key
class-attribute
instance-attribute
¶
user_public_key: str = Field(serialization_alias='owner')
Public Key of the Owner wallet
input_token
class-attribute
instance-attribute
¶
input_token: str = Field(serialization_alias='inputMint')
The address of the input token on the chain used to buy.
input_amount
class-attribute
instance-attribute
¶
input_amount: int = Field(serialization_alias='inAmount')
The amount of input token to use for the limit order.
output_token
class-attribute
instance-attribute
¶
output_token: str = Field(serialization_alias='outputMint')
The address of the output token on the chain that will bought.
output_amount
class-attribute
instance-attribute
¶
output_amount: int = Field(serialization_alias='outAmount')
The amount of output token to buy in the limit order.
expired_at_unix_time
class-attribute
instance-attribute
¶
expired_at_unix_time: int | None = Field(
default=None, serialization_alias="expiredAt"
)
Expiring date for the Limit Order expressed in UNIX time
referral_public_key
class-attribute
instance-attribute
¶
referral_public_key: str | None = Field(
default=None, serialization_alias="referralAccount"
)
The address of the account used to get referral fees.
referral_name
class-attribute
instance-attribute
¶
referral_name: str | None = Field(
default=None, serialization_alias="referralName"
)
PostLimitOrderCreateResponse
¶
PostLimitOrderCancelBody
¶
Bases: BaseModel
Model used to identify the body required by a POST Limit Order Cancel request.
PostLimitOrderCancelResponse
¶
Bases: BaseModel
Model used to represent the Limit Order Cancel endpoint from Jupiter API.
GetLimitOrderOpenAccount
¶
Bases: BaseModel
ori_input_token
class-attribute
instance-attribute
¶
ori_input_token: str = Field(alias='oriInAmount')
ori_output_amount
class-attribute
instance-attribute
¶
ori_output_amount: str = Field(alias='oriOutAmount')
expired_at_unix_time
class-attribute
instance-attribute
¶
expired_at_unix_time: int | None = Field(
default=None, alias="expiredAt"
)
GetLimitOrderOpen
¶
GetLimitOrderOpenResponse
¶
Bases: BaseModel
Model used to represent the Limit Order Opens endpoint from Jupiter API.
GetLimitOrderHistory
¶
Bases: BaseModel
ori_input_token
class-attribute
instance-attribute
¶
ori_input_token: str = Field(alias='oriInAmount')
ori_output_amount
class-attribute
instance-attribute
¶
ori_output_amount: str = Field(alias='oriOutAmount')
expired_at_unix_time
class-attribute
instance-attribute
¶
expired_at_unix_time: int | None = Field(
default=None, alias="expiredAt"
)
create_transaction_id
class-attribute
instance-attribute
¶
create_transaction_id: str = Field(alias='createTxid')
cancel_transaction_id
class-attribute
instance-attribute
¶
cancel_transaction_id: str | None = Field(
default=None, alias="cancelTxid"
)
parse_datetime
¶
parse_datetime(datetime_raw: str | datetime) -> datetime
Source code in src/cyhole/jupiter/schema.py
388 389 390 391 392 | |
validator_state
classmethod
¶
validator_state(state: str) -> str
Source code in src/cyhole/jupiter/schema.py
394 395 396 397 398 | |
GetLimitOrderHistoryResponse
¶
Bases: BaseModel
Model used to represent the Limit Order History endpoint from Jupiter API.
GetLimitOrderTradeHistoryOrder
¶
Bases: BaseModel
GetLimitOrderTradeHistory
¶
Bases: BaseModel
parse_datetime
¶
parse_datetime(datetime_raw: str | datetime) -> datetime
Source code in src/cyhole/jupiter/schema.py
422 423 424 425 426 | |