openapi: 3.0.3
info:
  title: Swap Coffee API
  version: 1.0.0
servers:
  - url: https://backend.swap.coffee/
  - url: http://localhost:8080/
tags:
  - name: Entity
    description: Tokens, pools, DEXes, etc.
  - name: Routing
    description: Core functionality of the aggregation service. Build routes, get transactions, etc.
  - name: Strategies
    description: Limit orders, DCA, VCA, etc.
  - name: Yield
    description: Yield aggregator functionality. Provides and handles routes to pools with the best yield.
  - name: Referral
    description: Everything related to the referral program of swap.coffee.
  - name: Cashback
    description: Cashback programs conducted on swap.coffee.
  - name: Claim
    description: Claiming various rewards available on swap.coffee.
  - name: Contests
    description: Timed contests based on trading volumes for certain token-pairs.
  - name: Staking
    description: Responsible of managing staked funds, corresponding rewards, etc.
  - name: DEX
    description: Core functionality of the Coffee DEX service.
  - name: LiquidityProvisioning
    description: Everything related to liquidity provisioning in DEXes.
  - name: Boosts
    description: Functionality to support incentives and rewards for liquidity providers among all DEXes.
  - name: Profile
    description: Retrieve information about user profiles.
  - name: Partnership
    description: Various functionality for our partners.
  - name: Statistics
    description: Retrieve information about dex aggregation stats.
  - name: DexTrades
    description: OHLCV charts.
  - name: Ton
    description: Retrieve information about TON entities.
  - name: Auth
    description: Auth operations. For internal usage only.
security:
  - { }
  - ApiKey: [ ]
paths:
  /v1/blockchains:
    get:
      tags: [ Entity ]
      summary: Get supported blockchains. Currently only TON is supported.
      operationId: getBlockchains
      responses:
        '200':
          description: list of blockchains
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiBlockchain'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dexes:
    get:
      tags: [ Entity ]
      summary: Returns list of supported decentralized exchanges supported by the service in the given blockchain
      operationId: getDexes
      parameters:
        - name: blockchain
          in: query
          schema:
            type: string
            example: ton
      responses:
        '200':
          description: list of decentralized exchanges
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiDex'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dex/{blockchain}/{name}:
    get:
      tags: [ Entity ]
      summary: Returns information about the given decentralized exchange for the given blockchain
      operationId: getDex
      parameters:
        - $ref: '#/components/parameters/pathBlockchain'
        - name: name
          in: path
          required: true
          schema:
            type: string
            example: stonfi
      responses:
        '200':
          description: pool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDex'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/liquid_staking_pools:
    get:
      tags: [ Entity ]
      summary: Returns list of liquid staking pools
      operationId: getLiquidStakingPools
      responses:
        '200':
          description: List of liquid staking pools
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiLiquidStakingPool'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/liquid_staking_pools/{address}:
    get:
      tags: [ Entity ]
      summary: Returns staking pool for given address
      operationId: getLiquidStakingPool
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
            example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
      responses:
        '200':
          description: Liquid staking pool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiLiquidStakingPoolData'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/pools:
    get:
      tags: [ Entity ]
      summary: Returns list of pools which correspond to the given params
      operationId: getPools
      parameters:
        - name: blockchains
          in: query
          required: false
          description: If set, only pools from given blockchains will be returned
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ApiSupportedBlockchain'
        - name: dexes
          in: query
          required: false
          description: If set, only pools from given DEXes will be returned
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ApiSupportedYields'
        - name: trusted
          in: query
          required: false
          description: Returns only those pools which are trusted by DEXes or community
          schema:
            type: boolean
            default: true
        - name: with_active_boosts
          in: query
          required: false
          description: Returns only pools which have active boosts
          schema:
            type: boolean
            default: false
        - name: recently_created
          in: query
          required: false
          description: Returns only pools created within last 24 hours
          schema:
            type: boolean
            default: false
        - name: with_liquidity_from
          in: query
          required: false
          description: If set, returns only pools in which liquidity has been partially provisioned by the given address
          schema:
            type: string
        - name: search_text
          in: query
          required: false
          description: If set, look for given (sub-)text within pool's address, token tickers and addresses
          schema:
            type: string
        - name: order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/ApiPoolSortOrder'
        - name: descending_order
          in: query
          required: false
          schema:
            type: boolean
            default: true
        - name: in_groups
          in: query
          required: false
          description: If set, groups pools by DEXes, then handles and returns each group separately
          schema:
            type: boolean
            default: false
        - $ref: '#/components/parameters/querySize10'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: List of corresponding pools
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiPoolsSearchResponse'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
    delete:
      tags: [ Entity ]
      summary: Clear pools metadata cache. For internal usage only
      operationId: clearPoolsCache
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/pools/metrics:
    get:
      tags: [ Entity ]
      summary: Returns trading metrics for pools
      operationId: getPoolsMetrics
      parameters:
        - name: pools_addresses
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
              example: EQC1v4xPDDY_JTS1Pghq0r9QcBpA0zCVuCNaENeF-cb1wUIS
      responses:
        '200':
          description: Pools trading metrics
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiPoolStatistics'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/pool/{blockchain}/{address}:
    get:
      tags: [ Entity ]
      summary: Returns information about the given liquidity pool for the given blockchain
      operationId: getPool
      parameters:
        - $ref: '#/components/parameters/pathBlockchain'
        - name: address
          in: path
          required: true
          schema:
            type: string
            example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
      responses:
        '200':
          description: pool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPool'
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Entity ]
      summary: Updates pool's data. For internal usage only
      operationId: updatePoolData
      parameters:
        - $ref: '#/components/parameters/pathBlockchain'
        - name: address
          in: path
          required: true
          schema:
            type: string
            example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
      responses:
        '200':
          description: pool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPool'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/pool/{blockchain}/by-token/{address}:
    get:
      tags: [ Entity ]
      summary: Returns list of pools associated with given token
      operationId: getPoolsByToken
      parameters:
        - $ref: '#/components/parameters/pathBlockchain'
        - name: address
          in: path
          required: true
          schema:
            type: string
            example: EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
        - name: dexes
          in: query
          schema:
            type: array
            items:
              type: string
              example: stonfi
        - $ref: '#/components/parameters/querySize10'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: list of pools
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiTrimmedPool'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/tokens:
    get:
      tags: [ Entity ]
      summary: Returns list of tokens supported by the service
      operationId: getTokens
      parameters:
        - name: listed
          in: query
          schema:
            type: boolean
            description: If true, only officially listed tokens are returned
            default: true
      responses:
        '200':
          description: list of tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiToken'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/tokens:
    get:
      tags: [ Entity ]
      summary: Returns list of tokens supported by the service
      operationId: getTokensV2
      parameters:
        - name: verification
          in: query
          schema:
            $ref: '#/components/schemas/ApiTokenVerification'
      responses:
        '200':
          description: list of tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiToken'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/token/{blockchain}/{address}:
    get:
      tags: [ Entity ]
      summary: Returns information about the given token for the given blockchain
      operationId: getToken
      parameters:
        - $ref: '#/components/parameters/pathBlockchain'
        - name: address
          in: path
          required: true
          schema:
            type: string
            example: EQAM2KWDp9lN0YvxvfSbI0ryjBXwM70rakpNIHbuETatRWA1
      responses:
        '200':
          description: token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiToken'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/token/{blockchain}/by-symbol/{symbol}:
    get:
      tags: [ Entity ]
      summary: Returns information about the given token by its symbol for the given blockchain
      operationId: getTokensBySymbol
      parameters:
        - $ref: '#/components/parameters/pathBlockchain'
        - name: symbol
          in: path
          required: true
          schema:
            type: string
            example: ARBUZ
      responses:
        '200':
          description: tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiToken'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/token/price:
    post:
      tags: [ Entity ]
      summary: Returns prices for given tokens
      operationId: getTokenPrices
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiTokenPricesRequest'
      responses:
        '200':
          description: prices
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiTokenPriceEntry'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/route:
    post:
      tags: [ Routing ]
      summary: Returns the best route for the given trade pair
      operationId: buildRoute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiRouteRequest'
      responses:
        '200':
          description: resulting route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRoute'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/route/multi:
    post:
      tags: [ Routing ]
      summary: Returns the best route for the given list of input tokens and output token
      operationId: buildMultiAssetRoute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiMultiAssetRouteRequest'
      responses:
        '200':
          description: resulting route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiMultiAssetRoute'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/route/smart:
    post:
      tags: [ Routing ]
      summary: Returns the best route for the given trade pair using smart settings
      operationId: buildRouteSmart
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiSmartRouteRequest'
      responses:
        '200':
          description: resulting route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRoute'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/route/transactions:
    post:
      tags: [ Routing ]
      summary: Returns pre-built transactions for the given route. It is assumed that transactions will be signed and sent by the sender via wallet
      operationId: buildTransactionsV2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiTransactionsRequest'
      responses:
        '200':
          description: transactions for the route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionsResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/unstake/ton/transaction:
    post:
      tags: [ Routing ]
      summary: Returns pre-built transaction for the given unstake request. It is assumed that transaction will be signed and sent by the sender via wallet
      operationId: buildTonUnstakeTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiTonStakingTransactionRequest'
      responses:
        '200':
          description: transaction for unstake
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionBoc'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/stake/ton/transaction:
    post:
      tags: [ Routing ]
      summary: Returns pre-built transaction for the given stake request. It is assumed that transaction will be signed and sent by the sender via wallet
      operationId: buildTonStakeTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiTonStakingTransactionRequest'
      responses:
        '200':
          description: transaction for stake
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionBoc'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/route/result:
    get:
      tags: [ Routing ]
      summary: Get route transactions execution result
      operationId: getTransactionsResult
      deprecated: true
      parameters:
        - name: query_id
          description: Actually it's route_id, but saved old naming for back-compatibility
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: transactions for the route
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiTransactionResult'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/route/result:
    get:
      tags: [ Routing ]
      summary: Get route transactions execution result
      operationId: getRouteResult
      parameters:
        - name: route_id
          in: query
          required: true
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: Result of the route transactions execution
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRouteResult'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/ton/wallet/{address}/version:
    get:
      tags: [ Ton ]
      summary: Returns wallet version and revision
      operationId: getWalletVersion
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
      responses:
        '200':
          description: Wallet version and revision; if not a wallet, zeroes are being returned
          content:
            application/json:
              schema:
                type: object
                required:
                  - version
                  - revision
                properties:
                  version:
                    type: integer
                  revision:
                    type: integer
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/ton/wallet/{address}/balance:
    get:
      tags: [ Ton ]
      summary: Get wallet balance in nanotons (1e-9 TON)
      operationId: getWalletBalance
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
      responses:
        '200':
          description: Wallet balance in nanotons
          content:
            application/json:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/profile/{address}/transactions:
    get:
      tags: [ Profile ]
      summary: Get historical account transactions on swap.coffee
      operationId: getHistoricalTransactions
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
        - name: token
          in: query
          description: If set, only transactions related to this token will be returned
          schema:
            type: string
            example: native
        - name: token2
          in: query
          description: If set, only transactions related to this token pair will be returned
          schema:
            type: string
            example: EQCl0S4xvoeGeFGijTzicSA8j6GiiugmJW5zxQbZTUntre-1
        - $ref: '#/components/parameters/querySize100'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: Historical account transactions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiHistoricalTransaction'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/profile/{address}/proof:
    post:
      tags: [ Profile ]
      summary: Validate TON proof for given account address
      operationId: validateProof
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiProofValidationRequest'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/profile/{address}/settings:
    get:
      tags: [ Profile ]
      summary: Get account settings
      operationId: getAccountSettings
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: Account settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiJson'
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Profile ]
      summary: Update account settings
      operationId: updateAccountSettings
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiJson'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/auth:
    get:
      tags: [ Auth ]
      summary: List existing auth tokens
      operationId: getAuthTokens
      responses:
        '200':
          description: tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiAuthToken'
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Auth ]
      summary: Create new auth token
      operationId: createAuthToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiCreateAuthTokenRequest'
      responses:
        '200':
          description: token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAuthToken'
        'default':
          $ref: '#/components/responses/ApiError'
    patch:
      tags: [ Auth ]
      summary: Edit existing auth token
      operationId: editAuthToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiEditAuthTokenRequest'
      responses:
        '200':
          description: token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAuthToken'
        'default':
          $ref: '#/components/responses/ApiError'
    delete:
      tags: [ Auth ]
      summary: Delete existing auth token
      operationId: deleteAuthToken
      parameters:
        - name: key
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/referral/{address}:
    get:
      tags: [ Referral ]
      summary: Get account's referral info
      operationId: getReferralInfo
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: Account's referral info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiReferralAccountInfo'
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Referral ]
      summary: Bind new referral
      operationId: bindReferral
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - name: referral
          in: query
          required: true
          schema:
            type: string
            example: user_UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
    delete:
      tags: [ Referral ]
      summary: Unbind existing referral. For internal usage only.
      operationId: unbindReferral
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
    patch:
      tags: [ Referral ]
      summary: Update referral's info. For internal usage only.
      operationId: updateReferral
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiReferralAccountInfoUpdate'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/referral/{address}/list:
    get:
      tags: [ Referral ]
      summary: Get account's list of referrals
      operationId: getReferralList
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
        - $ref: '#/components/parameters/querySize10'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: Account's list of referrals
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiReferralInfo'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/referral/alias/{alias}:
    get:
      tags: [ Referral ]
      summary: Get address for alias
      operationId: getReferralAliasValue
      parameters:
        - $ref: '#/components/parameters/pathAlias'
      responses:
        '200':
          description: Address for referral alias
          content:
            application/json:
              schema:
                type: string
                example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        'default':
          $ref: '#/components/responses/ApiError'
    delete:
      tags: [ Referral ]
      summary: Delete address alias
      operationId: deleteReferralAlias
      parameters:
        - $ref: '#/components/parameters/pathAlias'
      responses:
        '200':
          description: Ok
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Referral ]
      summary: Set referral address alias
      operationId: setReferralAlias
      parameters:
        - $ref: '#/components/parameters/pathAlias'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiReferralSetAliasRequest'
      responses:
        '200':
          description: Ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/claim/{address}:
    get:
      tags: [ Claim ]
      summary: Get account's claiming stats
      operationId: getClaimingStats
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
        - $ref: '#/components/parameters/queryClaimingType'
        - $ref: '#/components/parameters/querySize100'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: Account's claiming stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiClaimingStats'
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Claim ]
      summary: Claim tokens
      operationId: claimTokens
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
        - $ref: '#/components/parameters/queryClaimingType'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/ApiTokenClaimRequest'
      responses:
        '200':
          description: User's referral info
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/claim/{address}/state:
    get:
      tags: [ Claim ]
      summary: Get state of account claimings
      operationId: getAccountClaimingState
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
        - $ref: '#/components/parameters/queryClaimingType'
        - $ref: '#/components/parameters/querySize10'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: State of account's claimings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiClaimStateResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/claim/result:
    get:
      tags: [ Claim ]
      summary: Get claiming transaction execution result
      operationId: getClaimingTransactionResult
      parameters:
        - name: query_id
          description: Public query ids to track withdraw request
          in: query
          required: true
          schema:
            type: array
            items:
              type: integer
              format: int64
      responses:
        '200':
          description: Claiming transaction status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTxOperationStatus'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/claim/transfer:
    post:
      tags: [ Claim ]
      summary: Transfer available in claim-center tokens from one account to another. For internal usage only
      operationId: transferClaimTokens
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiClaimTransferRequest'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/cashback/:
    get:
      tags: [ Cashback ]
      summary: Get cashbacks info
      operationId: getCashbackInfos
      parameters:
        - name: distributor
          in: query
          required: false
          description: Address, from which, token will be distributed to participants
          schema:
            type: string
            example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        - name: token
          in: query
          required: false
          description: Cashback token
          schema:
            type: string
            example: EQCZ_pV6EJNSr6XpvPaa-IVkT6ImqkiPftRMOICJP1B_75wZ
        - name: active
          in: query
          required: false
          description: Filter out active promotions only
          schema:
            type: boolean
        - $ref: '#/components/parameters/querySize10'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: Account's cashback info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiCashbackInfoResponse'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Cashback ]
      summary: Create new cashback distribution. For internal usage only
      operationId: createCashback
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiCashbackCreateRequest'
      responses:
        '200':
          description: Created cashback
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiCashbackInfo'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/cashback/{id}:
    get:
      tags: [ Cashback ]
      summary: Get cashback info
      operationId: getCashbackInfo
      parameters:
        - $ref: '#/components/parameters/pathLongId'
      responses:
        '200':
          description: Cashback info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiCashbackInfo'
        'default':
          $ref: '#/components/responses/ApiError'
    patch:
      tags: [ Cashback ]
      summary: Update cashback information. For internal usage only
      operationId: updateCashback
      parameters:
        - $ref: '#/components/parameters/pathLongId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiCashbackUpdateRequest'
      responses:
        '200':
          description: Created cashback
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiCashbackInfo'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/cashback/user/{address}:
    get:
      tags: [ Cashback ]
      summary: Get cashback total info for user
      operationId: getUserCashbackInfoTotal
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: Account's earned stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUserCashbackInfoTotal'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/cashback/user/{address}/list:
    get:
      tags: [ Cashback ]
      summary: Get cashback promos rewards for user
      operationId: getUserCashbackInfo
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
        - $ref: '#/components/parameters/querySize10'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: Account's earned stats
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiUserCashbackInfo'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/contests:
    get:
      tags: [ Contests ]
      summary: Get contests
      operationId: getContests
      parameters:
        - name: active
          in: query
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: List of contests
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiContestInfoWithID'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Contests ]
      summary: Create new contest. For internal usage only
      operationId: createContest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiContestInfo'
      responses:
        '200':
          description: Created contest information with id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiContestInfoWithID'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/contests/{id}:
    get:
      tags: [ Contests ]
      summary: Get contest
      operationId: getContest
      parameters:
        - $ref: '#/components/parameters/pathIntId'
      responses:
        '200':
          description: Contest information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiContestInfoWithID'
        'default':
          $ref: '#/components/responses/ApiError'
    patch:
      tags: [ Contests ]
      summary: Update existing contest. For internal usage only
      operationId: updateContest
      parameters:
        - $ref: '#/components/parameters/pathIntId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiContestInfo'
      responses:
        '200':
          description: Updated contest information with id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiContestInfoWithID'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/contests/{id}/user/{address}:
    get:
      tags: [ Contests ]
      summary: Get user stats for contest
      operationId: getContestUserStats
      parameters:
        - $ref: '#/components/parameters/pathIntId'
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: User stats for given contest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiContestUserStats'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/contests/{id}/top:
    get:
      tags: [ Contests ]
      summary: Get top users' stats for contest
      operationId: getContestTopUsersStats
      parameters:
        - $ref: '#/components/parameters/pathIntId'
      responses:
        '200':
          description: User stats for given contest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiContestTopStats'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/contests/{id}/payout/token:
    post:
      tags: [ Contests ]
      summary: Payout rewards for this contest in token. For internal usage only
      operationId: payoutContestRewardsInToken
      parameters:
        - $ref: '#/components/parameters/pathIntId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiContestTokenPayoutInfo'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiContestTokenPayoutAccrual'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/{address}/wallet:
    get:
      tags: [ Strategies ]
      summary: Check whether strategies wallet exists for given account address.
      operationId: doesStrategyWalletExist
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: Wallet address
          content:
            application/json:
              schema:
                type: string
                example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        '404':
          description: Wallet does not exist
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Strategies ]
      summary: Get pre-built transaction for strategies wallet creation.
      operationId: getStrategyWalletCreationTransaction
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionBoc'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/eligibility/user/{address}:
    get:
      tags: [ Strategies ]
      summary: Checks whether user is eligible for using strategies
      operationId: isUserEligibleForUsingStrategies
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: Whether user is eligible for using strategy orders
          content:
            application/json:
              schema:
                type: boolean
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/eligibility/from-tokens:
    get:
      tags: [ Strategies ]
      summary: Get list of supported from-tokens for strategies
      operationId: getFromTokensEligibleForStrategies
      parameters:
        - in: query
          name: type
          required: true
          schema:
            $ref: '#/components/schemas/ApiStrategyOrderType'
      responses:
        '200':
          description: List of addresses of supported from-tokens for strategies
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/eligibility/to-tokens/{address}:
    get:
      tags: [ Strategies ]
      summary: Get list of supported to-tokens for strategies for given from-token
      operationId: getToTokensEligibleForStrategies
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
            example: EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
        - in: query
          name: type
          required: true
          schema:
            $ref: '#/components/schemas/ApiStrategyOrderType'
      responses:
        '200':
          description: List of addresses of supported to-tokens for strategies for given from-token
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/{address}/orders:
    get:
      tags: [ Strategies ]
      summary: Get strategy orders
      operationId: getStrategyOrders
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
        - $ref: '#/components/parameters/queryStrategyOrderType'
        - name: include_finished
          in: query
          description: By default, only active and pending cancellation orders are being returned
          schema:
            type: boolean
            default: false
        - $ref: '#/components/parameters/querySize100'
        - name: before_id
          in: query
          description: Return only those orders, which id is lower than the given one
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: Account's strategy orders
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiStrategyOrder'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/{address}/order:
    get:
      tags: [ Strategies ]
      summary: Get strategy order
      operationId: getStrategyOrder
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
        - name: id
          in: query
          required: true
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: Account's strategy order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiStrategyOrder'
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Strategies ]
      summary: Get pre-built transaction for strategy order creation
      operationId: getStrategyOrderCreationTransaction
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiStrategyOrderCreationRequest'
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionBoc'
        'default':
          $ref: '#/components/responses/ApiError'
    delete:
      tags: [ Strategies ]
      summary: Get pre-built transaction for strategy order cancellation
      operationId: getStrategyOrderCancellationTransaction
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
        - name: id
          in: query
          required: true
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionBoc'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/cancel/by-id/{id}:
    delete:
      tags: [ Strategies ]
      summary: Cancel strategy order by id. For internal usage only.
      operationId: cancelStrategyOrderByID
      parameters:
        - $ref: '#/components/parameters/pathIntId'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/cancel/by-wallet/{address}:
    delete:
      tags: [ Strategies ]
      summary: Cancel all strategy orders by proxy wallet. For internal usage only.
      operationId: cancelStrategyOrdersByProxyWallet
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/queryStrategyOrderType'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/cancel/by-tokens/{first}/{second}:
    delete:
      tags: [ Strategies ]
      summary: Cancel all strategy orders by given token pair. For internal usage only.
      operationId: cancelStrategyOrdersByTokenPair
      parameters:
        - in: path
          name: first
          required: true
          schema:
            type: string
            example: native
        - in: path
          name: second
          required: true
          schema:
            type: string
            example: native
        - $ref: '#/components/parameters/queryStrategyOrderType'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/cancel/all:
    delete:
      tags: [ Strategies ]
      summary: Cancel all strategy orders. For internal usage only.
      operationId: cancelAllStrategyOrders
      parameters:
        - $ref: '#/components/parameters/queryStrategyOrderType'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/strategies/wallet/payout:
    post:
      tags: [ Strategies ]
      summary: Make a payout from strategy wallet to wallet's owner. For internal usage only.
      operationId: payoutFromStrategyWallet
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiStrategyWalletPayout'
      responses:
        '200':
          description: ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/partnership/{address}/transactions:
    get:
      tags: [ Partnership ]
      summary: Get raw transaction records with specified partner's referral address. Requires associated x-api-key.
      operationId: getRawTransactionRecords
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: Raw transaction records
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiRawTransactionRecord'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/partnership/{address}/settings:
    get:
      tags: [ Partnership ]
      summary: Get partner settings. For internal usage only
      operationId: getPartnerSettings
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
      responses:
        '200':
          description: Partner settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPartnerSettings'
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Partnership ]
      summary: Set partner settings. For internal usage only
      operationId: setPartnerSettings
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiPartnerSettings'
      responses:
        '200':
          description: Ok
        'default':
          $ref: '#/components/responses/ApiError'
    delete:
      tags: [ Partnership ]
      summary: Delete partner settings. For internal usage only
      operationId: deletePartnerSettings
      parameters:
        - $ref: '#/components/parameters/pathWalletAddress'
      responses:
        '200':
          description: Ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/partnership/claiming/stats/{token}:
    get:
      tags: [ Partnership ]
      summary: Get token claiming global stats. Requires associated x-api-key.
      operationId: getPartnershipClaimingGlobalStats
      parameters:
        - $ref: '#/components/parameters/pathTokenAddress'
      responses:
        '200':
          description: Global stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPartnershipClaimingGlobalData'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/partnership/claiming/stats/{token}/{address}:
    get:
      tags: [ Partnership ]
      summary: Get token claiming user stats. Requires associated x-api-key.
      operationId: getPartnershipClaimingUserStats
      parameters:
        - $ref: '#/components/parameters/pathTokenAddress'
        - $ref: '#/components/parameters/pathWalletAddress'
      responses:
        '200':
          description: User stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPartnershipClaimingUserData'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/partnership/claiming/accrue:
    post:
      tags: [ Partnership ]
      summary: Accrue token to claim center. Requires associated x-api-key.
      operationId: accruePartnershipClaimingToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiPartnershipClaimingAccrualRequest'
      responses:
        '200':
          description: Ok
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/partnership/claiming:
    post:
      tags: [ Partnership ]
      summary: Register new partner token for claiming center. For internal usage only.
      operationId: registerPartnershipClaimingToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - access_token_name
                - token_address
                - distributor_address
                - total
              properties:
                access_token_name:
                  type: string
                token_address:
                  type: string
                distributor_address:
                  type: string
                total:
                  type: string
                  format: int128
      responses:
        '200':
          description: Ok
        'default':
          $ref: '#/components/responses/ApiError'
    patch:
      tags: [ Partnership ]
      summary: Increase total amount of existing partner token within claiming center. For internal usage only.
      operationId: updatePartnershipClaimingToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - access_token_name
                - token_address
                - amount
              properties:
                access_token_name:
                  type: string
                token_address:
                  type: string
                amount:
                  type: string
                  format: int128
      responses:
        '200':
          description: Global stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPartnershipClaimingGlobalData'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/partnership/staking/{master_address}/{address}:
    get:
      tags: [ Partnership ]
      summary: Get aggregated information about staking for specific user. Requires associated x-api-key.
      operationId: getPartnershipStakingUserInfo
      parameters:
        - $ref: '#/components/parameters/pathStakingMasterAddress'
        - $ref: '#/components/parameters/pathWalletAddress'
      responses:
        '200':
          description: Aggregated staking info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiStakingUserInfo'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/statistics/generic:
    get:
      tags: [ Statistics ]
      summary: Get generic statistic of dex aggregation.
      operationId: getGenericStats
      parameters:
        - name: from
          in: query
          required: true
          schema:
            type: integer
            format: int64
            minimum: 1
            description: Unix timestamp in seconds
        - name: to
          in: query
          required: true
          schema:
            type: integer
            format: int64
            description: Unix timestamp in seconds
      responses:
        '200':
          description: Generic statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTxStats'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dextrades/{token}/candles:
    get:
      tags: [ DexTrades ]
      summary: OHLCV candles for a token in a single pool (USD). Ascending by time.
      operationId: getDexTradesCandles
      parameters:
        - $ref: '#/components/parameters/pathTokenAddress'
        - name: resolution
          in: query
          required: true
          schema:
            type: integer
            format: int64
            minimum: 1
            description: Candle length in seconds
        - name: from
          in: query
          required: true
          schema:
            type: integer
            format: int64
            minimum: 0
            description: Unix timestamp in seconds
        - name: to
          in: query
          required: true
          schema:
            type: integer
            format: int64
            description: Unix timestamp in seconds
        - name: pool
          in: query
          required: false
          schema:
            type: string
            description: Pool contract address; omitted — the primary pool is resolved by the backend
        - name: currency
          in: query
          required: false
          schema:
            type: string
            enum: [ usd, ton ]
            default: usd
            description: |
              Currency the OHLC values are expressed in. Candles are stored in the
              pool's own quote token and converted by a single rate per bucket, so
              the candle shape is identical in every currency.
      responses:
        '200':
          description: candles of the pool, ascending by time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDexCandles'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dextrades/{token}/pools:
    get:
      tags: [ DexTrades ]
      summary: Pools of a token with TVL and 24h volume. TVL-known pools first (TVL desc).
      operationId: getDexTradesPools
      parameters:
        - $ref: '#/components/parameters/pathTokenAddress'
      responses:
        '200':
          description: pools of the token, TVL-known first
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiDexPool'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dextrades/{token}/trades:
    get:
      tags: [ DexTrades ]
      summary: Recent trades for a token (latest first).
      operationId: getDexTradesTrades
      parameters:
        - $ref: '#/components/parameters/pathTokenAddress'
        - name: limit
          in: query
          required: true
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 1000
        - name: offset
          in: query
          required: true
          schema:
            type: integer
            format: int32
            minimum: 0
      responses:
        '200':
          description: list of trades, latest first
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiDexTrade'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dextrades/{token}/stats:
    get:
      tags: [ DexTrades ]
      summary: Volumes, trade counts and unique traders over a window.
      operationId: getDexTradesStats
      parameters:
        - $ref: '#/components/parameters/pathTokenAddress'
        - name: from
          in: query
          required: true
          schema:
            type: integer
            format: int64
            minimum: 0
            description: Unix timestamp in seconds
        - name: to
          in: query
          required: true
          schema:
            type: integer
            format: int64
            description: Unix timestamp in seconds
      responses:
        '200':
          description: token stats over the window
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDexStats'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dextrades/{token}/mcap:
    get:
      tags: [ DexTrades ]
      summary: Current USD price and market cap (FDV) of a token.
      operationId: getDexTradesMarketCap
      parameters:
        - $ref: '#/components/parameters/pathTokenAddress'
      responses:
        '200':
          description: current price and market cap
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDexMarketCap'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dextrades/{token}/change:
    get:
      tags: [ DexTrades ]
      summary: Relative price change over a window (single pool).
      operationId: getDexTradesPriceChange
      parameters:
        - $ref: '#/components/parameters/pathTokenAddress'
        - name: resolution
          in: query
          required: true
          schema:
            type: integer
            format: int64
            minimum: 1
            description: Candle length in seconds
        - name: from
          in: query
          required: true
          schema:
            type: integer
            format: int64
            minimum: 0
            description: Unix timestamp in seconds
        - name: to
          in: query
          required: true
          schema:
            type: integer
            format: int64
            description: Unix timestamp in seconds
        - name: pool
          in: query
          required: false
          schema:
            type: string
            description: Pool contract address; omitted — the primary pool is resolved by the backend
      responses:
        '200':
          description: relative price change over the window
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDexPriceChange'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dextrades/activity:
    get:
      tags: [ DexTrades ]
      summary: Tokens with trades within the last active_within seconds, with metrics per window.
      operationId: getDexTradesActivity
      parameters:
        - name: active_within
          in: query
          required: true
          schema:
            type: integer
            format: int64
            minimum: 60
            description: Activity window in seconds (tokens with trades within it are returned)
        - name: windows
          in: query
          required: true
          schema:
            type: array
            items:
              type: integer
              format: int64
            description: Metric windows in seconds, each ending now (1..8 entries)
      responses:
        '200':
          description: >
            Active tokens ordered by activity-window volume descending, then by token (deterministic).
            CONTRACT: a token is absent from the response if and only if it had no trades within
            active_within; consumers may rely on absence to zero out their stats. Any future response
            size limit must be announced explicitly (flag/header), never applied silently.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiDexActivityToken'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/staking/list:
    get:
      tags: [ Staking ]
      summary: Get all stakings
      operationId: getAllStakings
      responses:
        '200':
          description: List of all stakings
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiStakingInfo'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/staking/result:
    get:
      tags: [ Staking ]
      summary: Get staking transaction execution result
      operationId: getStakingTransactionResult
      parameters:
        - name: query_id
          description: Public query id to track staking process
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Staking transaction status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTxOperationStatus'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/staking/{master_address}:
    get:
      tags: [ Staking ]
      summary: Get aggregated information about staking
      operationId: getStakingGlobalInfo
      parameters:
        - $ref: '#/components/parameters/pathStakingMasterAddress'
      responses:
        '200':
          description: Aggregated staking info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiStakingGlobalInfo'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/staking/{master_address}/{address}:
    get:
      tags: [ Staking ]
      summary: Get aggregated information about staking for specific user
      operationId: getStakingUserInfo
      parameters:
        - $ref: '#/components/parameters/pathStakingMasterAddress'
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: Aggregated staking info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiStakingUserInfo'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/staking/{master_address}/{address}/points:
    get:
      tags: [ Staking ]
      summary: Get user's staking points
      operationId: getPointsForUser
      parameters:
        - $ref: '#/components/parameters/pathStakingMasterAddress'
        - $ref: '#/components/parameters/pathWalletAddress'
        - name: from
          in: query
          required: false
          schema:
            type: integer
            format: int64
            minimum: 1
            description: Unix timestamp in seconds
      responses:
        '200':
          description: Returns user points
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUserPoints'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/staking/{master_address}/{address}/balances:
    get:
      tags: [ Staking ]
      summary: Get user's balances of staked tokens
      operationId: getStakingTokenBalances
      parameters:
        - $ref: '#/components/parameters/pathStakingMasterAddress'
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: User's balances
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiUserStakeTokenInfo'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/staking/{master_address}/positions/{address}:
    post:
      tags: [ Staking ]
      summary: Build transaction to create new staking position
      operationId: createStakingPosition
      parameters:
        - $ref: '#/components/parameters/pathStakingMasterAddress'
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/headerXVerify'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiCreateStakeRequest'
      responses:
        '200':
          description: Boc to open position with queryId to observe
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v2/staking/{master_address}/positions/{address}/{id}:
    post:
      tags: [ Staking ]
      summary: Build transaction to extend existing position
      operationId: extendStakingPosition
      parameters:
        - $ref: '#/components/parameters/pathStakingMasterAddress'
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/pathLongId'
        - $ref: '#/components/parameters/headerXVerify'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiExtendStakeRequest'
      responses:
        '200':
          description: Boc to extend position with queryId to observe
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
    delete:
      tags: [ Staking ]
      summary: Build transaction to close position and withdraw all money
      operationId: closeStakingPosition
      parameters:
        - $ref: '#/components/parameters/pathStakingMasterAddress'
        - $ref: '#/components/parameters/pathWalletAddress'
        - $ref: '#/components/parameters/pathLongId'
        - $ref: '#/components/parameters/headerXVerify'
      responses:
        '200':
          description: Boc to close with queryId to observe
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dex/vault/{asset}:
    get:
      tags: [ DEX ]
      summary: Get address of the vault of the given asset
      operationId: getDexVaultAddress
      parameters:
        - name: asset
          in: path
          required: true
          schema:
            type: string
            example: native
      responses:
        '200':
          description: Address of the vault
          content:
            application/json:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ DEX ]
      summary: Build transaction to create vault for the given asset
      operationId: createDexVault
      parameters:
        - name: asset
          in: path
          required: true
          schema:
            type: string
            example: native
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dex/pools:
    get:
      tags: [ DEX ]
      summary: Get dex pools by filter
      operationId: getDexPools
      parameters:
        - name: assets
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              example: EQCl0S4xvoeGeFGijTzicSA8j6GiiugmJW5zxQbZTUntre-1
      responses:
        '200':
          description: List of all existing pools. Recached time to time
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiCoffeeDexTrimmedPool'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/dex/pool:
    post:
      tags: [ DEX ]
      summary: Build transactions to create pool of the given asset pair
      operationId: createDexPool
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiDexPoolCreationRequest'
      responses:
        '200':
          description: Transactions to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDexPoolCreationResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/liquidity/position/{pool_address}/{user_address}:
    get:
      tags: [ LiquidityProvisioning ]
      summary: Return information about user's LP position in pool
      operationId: getUserLpPositionInPool
      parameters:
        - $ref: '#/components/parameters/headerXVerify'
        - name: pool_address
          in: path
          required: true
          schema:
            type: string
        - name: user_address
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: User's LP position in pool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUserPoolLpResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/liquidity/provision/{address}:
    post:
      tags: [ LiquidityProvisioning ]
      summary: Build transactions to provide liquidity to the given pool
      operationId: provideDexPoolLiquidity
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiDexPoolLiquidityProvisioningRequest'
      responses:
        '200':
          description: Transactions to be sent
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
    delete:
      tags: [ LiquidityProvisioning ]
      summary: Build transaction to withdraw liquidity from the given pool
      operationId: withdrawDexPoolLiquidity
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiDexPoolLiquidityWithdrawalRequest'
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/liquidity/migration/corresponding-pools:
    get:
      tags: [ LiquidityProvisioning ]
      summary: Returns pools on Coffee DEX that correspond to the pools of provided addresses
      operationId: getCorrespondingCoffeePools
      parameters:
        - name: pools_addresses
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
              example: EQC1v4xPDDY_JTS1Pghq0r9QcBpA0zCVuCNaENeF-cb1wUIS
      responses:
        '200':
          description: Corresponding pools on Coffee Dex
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiPoolInfo'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/liquidity/migration/{user_address}:
    get:
      tags: [ LiquidityProvisioning ]
      summary: Returns list of pools from which user may migrate tokens
      operationId: getUserPoolAvailableToMigrate
      parameters:
        - name: user_address
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: List of pools from which user may migrate tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiLpMigrationUserPoolInfo'
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ LiquidityProvisioning ]
      summary: Build transaction to migrate LP to swap.coffee DEX
      operationId: createLpMigrationRequest
      parameters:
        - name: user_address
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiLpMigrationUserRequest'
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/liquidity/migration/pools/{source_pool_address}:
    get:
      tags: [ LiquidityProvisioning ]
      summary: Returns list of pools that are possible for migration of LP.
      operationId: getPoolsPossibleToMigrate
      parameters:
        - name: source_pool_address
          in: path
          required: true
          description: Address of the pool from non-coffee DEX
          schema:
            type: string
      responses:
        '200':
          description: Possible pools to migrate LP
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiLpMigrationPoolDestination'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/liquidity/{pool_address}/total-supply:
    get:
      tags: [ LiquidityProvisioning ]
      summary: Returns pool total supply
      operationId: getPoolTotalSupply
      parameters:
        - name: pool_address
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Pool's total supply
          content:
            application/json:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/liquidity/result:
    get:
      tags: [ LiquidityProvisioning ]
      summary: Returns status of liquidity provisioning operation
      operationId: getLiquidityProvisionStatus
      parameters:
        - name: query_id
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Operation status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTxOperationStatus'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/boost/{pool_address}/apr:
    get:
      tags: [ Boosts ]
      summary: Returns pool's aggregated APR
      operationId: getBoostAggregatedAPR
      parameters:
        - name: pool_address
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Pool's aggregated APR
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBoostPoolApr'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/boost/{pool_address}:
    get:
      tags: [ Boosts ]
      summary: Returns list of boosts for the pool
      operationId: getBoostsForPool
      parameters:
        - name: pool_address
          in: path
          required: true
          schema:
            type: string
        - name: last_factory
          in: query
          schema:
            type: string
            default: ""
        - name: last_id
          in: query
          schema:
            type: integer
            format: int64
            default: 0
            minimum: 0
        - $ref: '#/components/parameters/querySize10'
      responses:
        '200':
          description: Active boosts for this pool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBoostAggregated'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/boost/user/{pool_address}/{user_address}:
    get:
      tags: [ Boosts ]
      summary: Returns user's earned boosts in given pool
      operationId: getBoostsForUserInPool
      parameters:
        - name: pool_address
          in: path
          required: true
          schema:
            type: string
        - name: user_address
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: User's earned boosts in given pools
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiClaimingTokenStats'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/boost/{pool_address}/{address}:
    post:
      tags: [ Boosts ]
      summary: Build transaction to create boost for pool in swap.coffee DEX
      operationId: createBoostRequest
      parameters:
        - name: pool_address
          in: path
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/headerXVerify'
        - $ref: '#/components/parameters/pathWalletAddress'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiCreateBoostRequest'
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/boost/{boost_factory}/{boost_id}:
    get:
      tags: [ Boosts ]
      summary: Get detailed info about boost. Works for Coffee DEX pools only
      operationId: getBoostsInfo
      parameters:
        - name: boost_factory
          in: path
          required: true
          schema:
            type: string
        - name: boost_id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Detailed boost info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBoost'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/boost/stonfi/{pool_address}/{user_address}:
    post:
      tags: [ Boosts ]
      summary: Build transaction to create stonfi farm position
      operationId: createStonfiFarmPosition
      parameters:
        - $ref: '#/components/parameters/headerXVerify'
        - name: pool_address
          in: path
          required: true
          schema:
            type: string
        - name: user_address
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiStonfiFarmRequest'
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/boost/stonfi/{pool_address}/{position_address}/{user_address}:
    delete:
      tags: [ Boosts ]
      summary: Build transaction to close farm position in stonfi
      operationId: finishStonfiFarmPosition
      parameters:
        - $ref: '#/components/parameters/headerXVerify'
        - name: pool_address
          in: path
          required: true
          schema:
            type: string
        - name: position_address
          in: path
          required: true
          schema:
            type: string
        - name: user_address
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/boost/result:
    get:
      tags: [ Boosts ]
      summary: Returns status of new boost creation operation. Works for Coffee DEX pools only
      operationId: getBoostStatus
      parameters:
        - name: query_id
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Operation status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTxOperationStatus'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/yield/pools:
    get:
      tags: [ Yield ]
      summary: Returns list of pools which correspond to the given params
      operationId: getYieldSearchResponse
      parameters:
        - name: blockchains
          in: query
          required: false
          description: If set, only pools from given blockchains will be returned
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ApiSupportedBlockchain'
        - name: providers
          in: query
          required: false
          description: If set, only pools from given pool providers will be returned
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ApiSupportedYields'
        - name: trusted
          in: query
          required: false
          description: Returns only those pools which are trusted by DEXes or community
          schema:
            type: boolean
            default: true
        - name: with_active_boosts
          in: query
          required: false
          description: Returns only pools which have active boosts
          schema:
            type: boolean
            default: false
        - name: recently_created
          in: query
          required: false
          description: Returns only pools created within last 24 hours
          schema:
            type: boolean
            default: false
        - name: with_liquidity_from
          in: query
          required: false
          description: If set, returns only pools in which liquidity has been partially provisioned by the given address
          schema:
            type: string
        - name: my_tokens_filter_address
          in: query
          required: false
          description: If set, returns liquidity sources, where this user can supply it's tokens
          schema:
            type: string
            description: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        - name: search_text
          in: query
          required: false
          description: If set, look for given (sub-)text within pool's address, token tickers and addresses
          schema:
            type: string
        - name: order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/ApiPoolSortOrder'
        - name: descending_order
          in: query
          required: false
          schema:
            type: boolean
            default: true
        - name: in_groups
          in: query
          required: false
          description: If set, groups pools by liquidity providers, then handles and returns each group separately
          schema:
            type: boolean
            default: false
        - $ref: '#/components/parameters/querySize10'
        - $ref: '#/components/parameters/queryPage'
      responses:
        '200':
          description: List of corresponding pools
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiYieldSearchResponse'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/yield/pool/{pool_address}:
    get:
      tags: [ Yield ]
      summary: Returns detailed information about requested pool
      operationId: getYieldDetails
      parameters:
        - name: pool_address
          in: path
          required: true
          description: Pool address
          schema:
            type: string
      responses:
        '200':
          description: Detailed information about requested pool, with incentives and so on
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiYieldDetails'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/yield/token/{token_address}/tvl:
    get:
      tags: [ Yield ]
      summary: Returns total TVL in USD across all yield pools which contain the given token
      operationId: getYieldTokenTvl
      parameters:
        - name: token_address
          in: path
          required: true
          description: Token address ('native' for TON)
          schema:
            type: string
      responses:
        '200':
          description: Total TVL of yield pools containing the token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiYieldTokenTvl'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/yield/token/{token_address}/lp-address:
    get:
      tags: [ Yield ]
      summary: Returns LP token addresses of top 100 dex pools containing the given token, ordered by liquidity descending
      operationId: getYieldTokenLpAddresses
      parameters:
        - name: token_address
          in: path
          required: true
          description: Token address; 'native' (TON) is not supported and results in an error
          schema:
            type: string
      responses:
        '200':
          description: LP token addresses of top 100 dex pools containing the token, ordered by TVL descending
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiYieldTokenLp'
          headers:
            Cache-Control:
              schema:
                type: string
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/yield/pool/{pool_address}/{user_address}:
    get:
      tags: [ Yield ]
      summary: Returns detailed information about user's position in the pool
      operationId: getYieldUserDetails
      parameters:
        - name: pool_address
          in: path
          required: true
          description: Pool address
          schema:
            type: string
        - name: user_address
          in: path
          required: true
          description: User address
          schema:
            type: string
      responses:
        '200':
          description: Detailed information about user's position in requested pool, with incentives and so on
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiYieldUserDetails'
        'default':
          $ref: '#/components/responses/ApiError'
    post:
      tags: [ Yield ]
      summary: Interact with yield pool
      operationId: interactYieldPoolUser
      parameters:
        - name: pool_address
          in: path
          required: true
          description: Pool address
          schema:
            type: string
        - name: user_address
          in: path
          required: true
          description: User address
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiYieldInteractionRequest'
      responses:
        '200':
          description: Transaction to be sent
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiTransactionResponse'
        'default':
          $ref: '#/components/responses/ApiError'
  /v1/yield/result:
    get:
      tags: [ Yield ]
      summary: Returns status of interaction with yield pool operation
      operationId: getYieldPoolInteractionStatus
      parameters:
        - name: query_id
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Operation status
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiTxOperationStatus'
        'default':
          $ref: '#/components/responses/ApiError'
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      name: X-Api-Key
      in: header
  parameters:
    headerXVerify:
      in: header
      name: x-verify
      required: true
      description: TON proof for the given address
      schema:
        type: string
    pathBlockchain:
      in: path
      name: blockchain
      required: true
      schema:
        type: string
        example: ton
    pathTokenAddress:
      in: path
      name: token
      required: true
      schema:
        type: string
        example: EQCl0S4xvoeGeFGijTzicSA8j6GiiugmJW5zxQbZTUntre-1
    pathWalletAddress:
      in: path
      name: address
      required: true
      schema:
        type: string
        example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
    pathIntId:
      in: path
      name: id
      required: true
      schema:
        type: integer
        format: int32
    pathLongId:
      in: path
      name: id
      required: true
      schema:
        type: integer
        format: int64
    pathAlias:
      in: path
      name: alias
      required: true
      schema:
        type: string
        example: club100
    pathStakingMasterAddress:
      in: path
      name: master_address
      required: true
      schema:
        type: string
        example: EQCMtrnKhK82Yw6xHrLm_rJLkMYxeYIilhdmn6BnVGZ1PnBM
    queryClaimingType:
      in: query
      name: type
      required: true
      schema:
        $ref: '#/components/schemas/ApiClaimingType'
    queryPage:
      in: query
      name: page
      schema:
        type: integer
        format: int32
        minimum: 1
        default: 1
    querySize10:
      in: query
      name: size
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 100
        default: 10
    querySize100:
      in: query
      name: size
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 100
        default: 100
    queryStrategyOrderType:
      in: query
      name: type
      schema:
        $ref: '#/components/schemas/ApiStrategyOrderType'
  responses:
    ApiError:
      description: Some error during request processing
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
  schemas:
    ApiDexCandles:
      type: object
      required: [ candles ]
      properties:
        pool:
          type: string
          description: Pool the candles were computed for; absent — no pool found for the token
        candles:
          type: array
          items:
            $ref: '#/components/schemas/ApiDexCandle'
    ApiDexPool:
      type: object
      required: [ pool, dex, volume_24h_usd, trades_24h ]
      properties:
        pool:
          type: string
        dex:
          type: string
        tvl_usd:
          type: number
          format: double
          description: TVL from the yield aggregator; absent if unknown
        volume_24h_usd:
          type: number
          format: double
        trades_24h:
          type: integer
          format: int64
    ApiDexCandle:
      type: object
      required: [ time, open, high, low, close, volume, trades ]
      properties:
        time:
          type: integer
          format: int64
          description: Unix timestamp (seconds) of the bar start
        open:
          type: number
          format: double
        high:
          type: number
          format: double
        low:
          type: number
          format: double
        close:
          type: number
          format: double
        volume:
          type: number
          format: double
          description: USD volume
        trades:
          type: integer
          format: int64
    ApiDexTrade:
      type: object
      required: [ time, wallet, dex, pool, price_usd, volume_usd, is_buy ]
      properties:
        time:
          type: integer
          format: int64
        wallet:
          type: string
        dex:
          type: string
        pool:
          type: string
        price_usd:
          type: number
          format: double
        volume_usd:
          type: number
          format: double
        is_buy:
          type: boolean
    ApiDexStats:
      type: object
      required: [ volume_total, volume_buy, volume_sell, trades_total, trades_buy, trades_sell, unique_traders, unique_buyers, unique_sellers ]
      properties:
        volume_total:
          type: number
          format: double
        volume_buy:
          type: number
          format: double
        volume_sell:
          type: number
          format: double
        trades_total:
          type: integer
          format: int64
        trades_buy:
          type: integer
          format: int64
        trades_sell:
          type: integer
          format: int64
        unique_traders:
          type: integer
          format: int64
        unique_buyers:
          type: integer
          format: int64
        unique_sellers:
          type: integer
          format: int64
    ApiDexMarketCap:
      type: object
      properties:
        price_usd:
          type: number
          format: double
          nullable: true
        market_cap_usd:
          type: number
          format: double
          nullable: true
    ApiDexPriceChange:
      type: object
      properties:
        change:
          type: number
          format: double
          nullable: true
          description: Relative change over the window (0.05 = +5%)
    ApiDexActivityWindow:
      type: object
      required: [ window, volume_usd_total, volume_usd_buy, volume_usd_sell, trades_total, trades_buy, trades_sell, uniq_traders, uniq_buyers, uniq_sellers ]
      properties:
        window:
          type: integer
          format: int64
          description: Window length in seconds (aligned up to a minute)
        change:
          type: number
          format: double
          nullable: true
          description: Relative price change over the window (0.05 = +5%); null if no bars in window
        volume_usd_total:
          type: number
          format: double
        volume_usd_buy:
          type: number
          format: double
        volume_usd_sell:
          type: number
          format: double
        trades_total:
          type: integer
          format: int64
        trades_buy:
          type: integer
          format: int64
        trades_sell:
          type: integer
          format: int64
        uniq_traders:
          type: integer
          format: int64
        uniq_buyers:
          type: integer
          format: int64
        uniq_sellers:
          type: integer
          format: int64
    ApiDexActivityToken:
      type: object
      required: [ token, price_usd, windows ]
      properties:
        token:
          type: string
        price_usd:
          type: number
          format: double
          description: Close of the latest bar
        tvl_usd:
          type: number
          format: double
          nullable: true
          description: Sum of TVL of yield pools containing the token; null until yield state is warmed up
        pools_count:
          type: integer
          format: int32
          nullable: true
        windows:
          type: array
          description: >
            One entry per requested window (deduplicated, sorted ascending), always present even if
            the window had no trades (zero volumes/counters, change null). trades_total == 0 is the
            definitive "no trades in this window" marker.
          items:
            $ref: '#/components/schemas/ApiDexActivityWindow'
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: error description
    ApiBlockchain:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          example: ton
    ApiTokenAddress:
      type: object
      required:
        - blockchain
        - address
      properties:
        blockchain:
          type: string
          example: ton
        address:
          type: string
          example: native
    ApiTokenVerification:
      type: string
      enum:
        - whitelisted
        - blacklisted
        - community
        - unknown
    ApiTokenMetadata:
      type: object
      required:
        - name
        - symbol
        - decimals
        - listed
        - verification
      properties:
        name:
          type: string
          example: ARBUZ
        symbol:
          type: string
          example: ARBUZ
        decimals:
          type: integer
          format: int32
        image_url:
          type: string
        listed:
          type: boolean
        verification:
          $ref: '#/components/schemas/ApiTokenVerification'
    ApiToken:
      type: object
      required:
        - address
        - metadata
      properties:
        address:
          $ref: '#/components/schemas/ApiTokenAddress'
        metadata:
          $ref: '#/components/schemas/ApiTokenMetadata'
    ApiMultiAssetInputAsset:
      type: object
      required:
        - token
        - amount
      properties:
        token:
          $ref: '#/components/schemas/ApiTokenAddress'
        amount:
          type: number
          format: double
          description: Input amount in tokens (not nano!) to be swapped
          minimum: 0.0
          exclusiveMinimum: true
    ApiDex:
      type: object
      required:
        - blockchain
        - name
      properties:
        blockchain:
          type: string
          example: ton
        name:
          type: string
          example: stonfi
    ApiAmmType:
      type: string
      enum:
        - constant_product
        - cubic_stable
        - curve_fi_stable
        - concentrated_v3
        - tonstakers
        - weighted_constant_product
        - weighted_stable
        - bidask
        - moon_dlmm
        - bidask_damm
        - dedust_v2
    ApiPoolFees:
      type: object
      required:
        - average_gas
      properties:
        average_gas:
          type: number
          format: double
        divider:
          type: integer
          format: int64
        input:
          type: integer
          format: int64
        output:
          type: integer
          format: int64
        first_token:
          type: integer
          format: int64
        second_token:
          type: integer
          format: int64
    ApiPoolReserves:
      type: array
      items:
        type: number
        format: double
    ApiTokenRestrictions:
      type: object
      properties:
        min_swap_amount:
          type: number
          format: double
        max_swap_amount:
          type: number
          format: double
    ApiPoolType:
      type: string
      enum:
        - public
        - private
        - slumbering
        - invalid
    ApiTrimmedPool:
      type: object
      required:
        - dex
        - address
        - type
        - amm_type
        - tokens
        - reserves
        - fees
      properties:
        dex:
          type: string
          example: stonfi
        address:
          type: string
        type:
          $ref: '#/components/schemas/ApiPoolType'
        amm_type:
          $ref: '#/components/schemas/ApiAmmType'
        amm_settings:
          $ref: '#/components/schemas/ApiJson'
        tokens:
          type: array
          items:
            type: string
            example: EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
        reserves:
          $ref: '#/components/schemas/ApiPoolReserves'
        restrictions:
          type: array
          items:
            $ref: '#/components/schemas/ApiTokenRestrictions'
        fees:
          $ref: '#/components/schemas/ApiPoolFees'
        unavailable_until:
          type: integer
          format: int64
          description: UTC unix timestamp in seconds
    ApiCoffeeDexTrimmedPool:
      type: object
      required:
        - address
        - amm_type
        - tokens
        - reserves
        - fees
      properties:
        address:
          type: string
          example: EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
        amm_type:
          $ref: '#/components/schemas/ApiAmmType'
        amm_settings:
          $ref: '#/components/schemas/ApiJson'
        tokens:
          type: array
          items:
            type: string
            example: EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
        reserves:
          $ref: '#/components/schemas/ApiPoolReserves'
        unavailable_until:
          type: integer
          format: int64
          description: UTC unix timestamp in seconds
    ApiPool:
      type: object
      required:
        - dex
        - address
        - type
        - amm_type
        - tokens
        - reserves
        - fees
      properties:
        dex:
          type: string
          example: stonfi
        address:
          type: string
        type:
          $ref: '#/components/schemas/ApiPoolType'
        amm_type:
          $ref: '#/components/schemas/ApiAmmType'
        amm_settings:
          $ref: '#/components/schemas/ApiJson'
        tokens:
          type: array
          items:
            $ref: '#/components/schemas/ApiToken'
        reserves:
          $ref: '#/components/schemas/ApiPoolReserves'
        restrictions:
          type: array
          items:
            $ref: '#/components/schemas/ApiTokenRestrictions'
        fees:
          $ref: '#/components/schemas/ApiPoolFees'
        unavailable_until:
          type: integer
          format: int64
          description: UTC unix timestamp in seconds
    ApiPoolCLMM:
      type: object
      required:
        - pool
        - sqrtPriceX96
        - liquidity
        - tick
        - ticks
        - jetton0PriceUsd
        - jetton1PriceUsd
      properties:
        pool:
          $ref: '#/components/schemas/ApiPool'
        sqrtPriceX96:
          type: string
          description: Current pool price in sqrtPriceX96 format
        liquidity:
          type: string
          description: Current available liquidity in the pool
        tick:
          type: integer
          format: int64
          description: Current pool tick
        ticks:
          $ref: '#/components/schemas/ApiJson'
        jetton0PriceUsd:
          type: number
          format: double
          description: Price of the first jetton in USD
        jetton1PriceUsd:
          type: number
          format: double
          description: Price of the second jetton in USD
    ApiPoolDLMM:
      type: object
      required:
        - pool
        - current_sqrt_price
        - active_bin
        - bin_step
        - base_bin_step
        - bins
      properties:
        pool:
          $ref: '#/components/schemas/ApiPool'
        current_sqrt_price:
          type: number
          format: double
          description: Current sqrt price
        active_bin:
          type: integer
          description: Active bin index
        bin_step:
          type: integer
          description: Bin step in basis points
        base_bin_step:
          type: integer
          description: Base bin step coefficient (denominator)
        bins:
          type: object
          description: Available bins
          additionalProperties:
            type: object
            properties:
              liquidity:
                type: string
                format: bigint
                description: Raw liquidity amount
              amount_x:
                type: number
                format: double
                description: Amount of token X
              amount_y:
                type: number
                format: double
                description: Amount of token X
              price_lower:
                type: number
                format: double
                description: Lower bound of the price
              price_upper:
                type: number
                format: double
                description: Upper bound of the price
    ApiLiquidStakingPool:
      type: object
      properties:
        protocol:
          type: string
        address:
          type: string
        base_token:
          $ref: '#/components/schemas/ApiToken'
        liquid_token:
          $ref: '#/components/schemas/ApiToken'
        supports_tx_building:
          type: boolean
      required:
        - protocol
        - address
        - base_token
        - liquid_token
        - supports_tx_building
    ApiLiquidStakingPoolStats:
      properties:
        rate:
          type: number
          format: double
        cycle_end:
          type: number
          format: int64
        tvl_usd:
          type: number
          format: double
        apr:
          type: number
          format: double
      required:
        - rate
        - cycle_end
        - tvl_usd
        - apr
    ApiLiquidStakingPoolData:
      type: object
      properties:
        pool:
          $ref: '#/components/schemas/ApiLiquidStakingPool'
        stats:
          $ref: '#/components/schemas/ApiLiquidStakingPoolStats'
      required:
        - pool
        - stats
    ApiLendingPool:
      type: object
      properties:
        protocol:
          type: string
        address:
          type: string
        token:
          $ref: '#/components/schemas/ApiToken'
        supports_tx_building:
          type: boolean
      required:
        - protocol
        - address
        - token
        - supports_tx_building
    ApiLendingPoolStats:
      properties:
        available_liquidity:
          type: number
          format: double
        liquidation_threshold:
          type: number
          format: double
        liquidation_bonus:
          type: number
          format: double
        collateral_factor:
          type: number
          format: double
      required:
        - available_liquidity
        - liquidation_threshold
        - liquidation_bonus
        - collateral_factor
    ApiPerpetualVaultPool:
      type: object
      properties:
        protocol:
          type: string
        address:
          type: string
        quote_token:
          $ref: '#/components/schemas/ApiToken'
        lp_token:
          $ref: '#/components/schemas/ApiToken'
        exchange_rate:
          type: string
          format: bigint
        normalizer:
          type: string
          format: bigint
      required:
        - protocol
        - address
        - quote_token
        - lp_token
        - exchange_rate
        - normalizer
    ApiDefiLendingPool:
      type: object
      properties:
        address:
          type: string
        token:
          $ref: '#/components/schemas/ApiToken'
        exchange_rate:
          type: string
          format: bigint
        normalizer:
          type: string
          format: bigint
        remaining_liquidity_to_supply:
          type: string
          format: bigint
      required:
        - address
        - token
        - exchange_rate
        - normalizer
    ApiSwapResult:
      type: string
      description: Result of the swap
      enum:
        - fully_fulfilled
        - partially_fulfilled
        - unavailable
    ApiSwap:
      type: object
      required:
        - result
        - input_amount
        - output_amount
        - before_reserves
        - after_reserves
      properties:
        result:
          $ref: '#/components/schemas/ApiSwapResult'
        input_amount:
          type: number
          format: double
        output_amount:
          type: number
          format: double
        before_reserves:
          $ref: '#/components/schemas/ApiPoolReserves'
        after_reserves:
          $ref: '#/components/schemas/ApiPoolReserves'
        reason:
          type: string
        left_amount:
          type: number
          format: double
    ApiRecommendedGas:
      type: object
      required:
        - blockchain
        - amount
      properties:
        blockchain:
          type: string
          example: ton
        amount:
          type: number
          format: double
    ApiRoutingStep:
      type: object
      required:
        - blockchain
        - dex
        - pool_address
        - input_token
        - output_token
        - swap
        - recommended_gas
        - average_gas
      properties:
        blockchain:
          type: string
          example: ton
        dex:
          type: string
          example: stonfi
        pool_address:
          type: string
        input_token:
          $ref: '#/components/schemas/ApiToken'
        output_token:
          $ref: '#/components/schemas/ApiToken'
        swap:
          $ref: '#/components/schemas/ApiSwap'
        recommended_gas:
          type: number
          format: double
        average_gas:
          type: number
          format: double
        next:
          type: array
          items:
            $ref: '#/components/schemas/ApiRoutingStep'
    ApiSwapTransaction:
      type: object
      required:
        - address
        - value
        - cell
        - send_mode
        - query_id
      properties:
        address:
          type: string
          example: EQCM3B12QK1e4yZSf8GtBRT0aLMNyEsBc_DhVfRRtOEffLez
        value:
          type: string
          format: int128
          description: Amount of nanotons to be sent. Can be passed to TonConnect transaction.
        cell:
          type: string
          description: Base64-encoded cell. Treated as a payload field in TonConnect transaction.
          format: base64
        stateInit:
          type: string
          description: Base64-encoded stateInit cell. Used to deploy a contract
          format: base64
        send_mode:
          type: integer
          format: int32
          description: 'Internal message send mode. More: https://docs.ton.org/develop/smart-contracts/messages#message-modes'
        query_id:
          type: integer
          format: int64
          description: Unique identifier of the query used for tracking swap.coffee transactions among others
    ApiExtraCurrency:
      type: object
      required:
        - id
        - amount
      properties:
        id:
          type: integer
          format: int64
        amount:
          type: string
          format: int128
    ApiTransactionBoc:
      type: object
      required:
        - payload_cell
        - address
        - value
      properties:
        payload_cell:
          type: string
          format: base64
          description: Base64-encoded cell. Treated as a payload field in TonConnect transaction.
        address:
          type: string
          example: EQCM3B12QK1e4yZSf8GtBRT0aLMNyEsBc_DhVfRRtOEffLez
        value:
          type: string
          format: int128
          description: Amount of nanotons to be sent. Can be passed to TonConnect transaction.
        state_init:
          type: string
          format: base64
          description: Base64-encoded cell. Treated as a stateInit field in TonConnect transaction.
        extra:
          type: array
          items:
            $ref: '#/components/schemas/ApiExtraCurrency'
    ApiTransactionsResponse:
      type: object
      required:
        - route_id
        - transactions
      properties:
        route_id:
          type: integer
          description: Unique identifier of the route used for tracking.
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/ApiSwapTransaction'
    ApiRoute:
      type: object
      required:
        - input_token
        - output_token
        - input_amount
        - output_amount
        - input_usd
        - output_usd
        - recommended_gas
        - price_impact
        - paths
      properties:
        input_token:
          $ref: '#/components/schemas/ApiToken'
        output_token:
          $ref: '#/components/schemas/ApiToken'
        input_amount:
          type: number
          format: double
        output_amount:
          type: number
          format: double
        input_usd:
          type: number
          format: double
        output_usd:
          type: number
          format: double
        savings:
          type: number
          format: double
        left_amount:
          type: number
          format: double
        recommended_gas:
          type: number
          format: double
        price_impact:
          type: number
          format: double
        estimated_cashback_usd:
          type: number
          format: double
        partner_commission_ton:
          type: number
          format: double
        mev_protection_fee:
          type: number
          description: Fees for the usage of MEV protection.
          format: double
        paths:
          type: array
          items:
            $ref: '#/components/schemas/ApiRoutingStep'
    ApiMultiAssetRoute:
      type: object
      required:
        - routes
        - output_token
        - total_output_amount
      properties:
        routes:
          type: array
          items:
            $ref: '#/components/schemas/ApiRoute'
        output_token:
          $ref: '#/components/schemas/ApiToken'
        total_output_amount:
          type: number
          format: double
        total_savings:
          type: number
          format: double
        total_estimated_cashback_usd:
          type: number
          format: double
        total_partner_commission_ton:
          type: number
          format: double
        total_mev_protection_fee:
          type: number
          description: Fees for the usage of MEV protection.
          format: double
    ApiPoolSelector:
      type: object
      description: Configures the DEX pools that can appear in the generated route. By setting blockchains = ["ton"] inside it, you can remove the dexes field; max_volatility allows you to exclude pools whose volatility has been above a certain percentage in the last 15 minutes. This makes sense when you allow 2-3 intermediate tokens or a large number of splits to smooth out potential issues.
      properties:
        blockchains:
          description: 'If specified, only pools from given blockchains will be used for routing'
          type: array
          minItems: 1
          items:
            type: string
            example: ton
        dexes:
          description: 'If specified, only pools from given dexes will be used for routing'
          type: array
          minItems: 1
          items:
            type: string
            example: dedust
        max_volatility:
          description: 'If specified, only pools with volatility lower than given value will be used for routing'
          type: number
          format: double
          minimum: 0.0
    ApiRouteRequestAdditionalData:
      type: object
      properties:
        sender_address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        referral_name:
          type: string
          example: tonkeeper
    ApiRouteRequest:
      type: object
      required:
        - input_token
        - output_token
      properties:
        input_token:
          $ref: '#/components/schemas/ApiTokenAddress'
        output_token:
          $ref: '#/components/schemas/ApiTokenAddress'
        input_amount:
          type: number
          format: double
          description: Input amount in tokens (not nano!) to be swapped
          minimum: 0.0
          exclusiveMinimum: true
        output_amount:
          type: number
          description: If specified, the route will be built to get the specified output amount. If not specified, the route will be built to get the maximum output amount for the given input amount.
          format: double
          minimum: 0.0
          exclusiveMinimum: true
        max_splits:
          type: integer
          format: int32
          description: Defines the maximum number of independent paths (i.e., transactions) the route can split into. For v4 wallets, you can omit this or set it to 4; for v5 wallets, you can set it to 20 (this is our internal upper limit, and we may reduce it later to something like 10).
          minimum: 1
          maximum: 20
          default: 4
        max_length:
          type: integer
          format: int32
          description: Defines the maximum length of each path in tokens. It accepts values from [2; 5]. If it's 2, only direct swaps A -> B without multihops are possible. If it's 3, there can be a maximum of 1 intermediate token, i.e., A -> X -> B. If it's 4/5, there can be 2/3 intermediate tokens. A value of 2 deprives you of more profitable exchanges by finding market inefficiencies and does not allow you to exchange tokens without a direct pair (since there can be no intermediate tokens). The higher the value, the more profitable routes can be built, but the higher the likelihood that the user ends up with an intermediate token (since our blockchain is asynchronous, and some swap in the middle of the route may fail due to slippage).
          minimum: 2
          maximum: 5
          default: 3
        pool_selector:
          $ref: '#/components/schemas/ApiPoolSelector'
        mev_protection:
          type: boolean
          description: Whether a MEV protection should be enabled
          example: true
        additional_data:
          $ref: '#/components/schemas/ApiRouteRequestAdditionalData'
    ApiMultiAssetRouteRequest:
      type: object
      required:
        - input_assets
        - output_asset
      properties:
        input_assets:
          type: array
          items:
            $ref: '#/components/schemas/ApiMultiAssetInputAsset'
        output_asset:
          $ref: '#/components/schemas/ApiTokenAddress'
        max_splits:
          type: integer
          format: int32
          description: Defines the maximum number of independent paths (i.e., transactions) . For v4 wallets, you can omit this or set it to 4; for v5 wallets, you can set it to 100 (this is our internal upper limit, and we may reduce it later). No more than 20 splits will be used for single input_asset.
          minimum: 1
          maximum: 50
          default: 4
        max_length:
          type: integer
          format: int32
          description: Defines the maximum length of each path in tokens. It accepts values from [2; 5]. If it's 2, only direct swaps A -> B without multihops are possible. If it's 3, there can be a maximum of 1 intermediate token, i.e., A -> X -> B. If it's 4/5, there can be 2/3 intermediate tokens. A value of 2 deprives you of more profitable exchanges by finding market inefficiencies and does not allow you to exchange tokens without a direct pair (since there can be no intermediate tokens). The higher the value, the more profitable routes can be built, but the higher the likelihood that the user ends up with an intermediate token (since our blockchain is asynchronous, and some swap in the middle of the route may fail due to slippage).
          minimum: 2
          maximum: 5
          default: 3
        pool_selector:
          $ref: '#/components/schemas/ApiPoolSelector'
        mev_protection:
          type: boolean
          description: Whether a MEV protection should be enabled
          example: true
        additional_data:
          $ref: '#/components/schemas/ApiRouteRequestAdditionalData'
    ApiSmartRouteRequest:
      type: object
      required:
        - input_token
        - output_token
      properties:
        input_token:
          $ref: '#/components/schemas/ApiTokenAddress'
        output_token:
          $ref: '#/components/schemas/ApiTokenAddress'
        input_amount:
          type: number
          format: double
          description: Input amount in tokens (not nano!) to be swapped
          minimum: 0.0
          exclusiveMinimum: true
        output_amount:
          type: number
          description: If specified, the route will be built to get the specified output amount. If not specified, the route will be built to get the maximum output amount for the given input amount.
          format: double
          minimum: 0.0
          exclusiveMinimum: true
        max_splits:
          type: integer
          format: int32
          description: Defines the maximum number of independent paths (i.e., transactions) the route can split into. For v4 wallets, you can omit this or set it to 4; for v5 wallets, you can set it to 20 (this is our internal upper limit, and we may reduce it later to something like 10).
          minimum: 1
          maximum: 20
          default: 4
        additional_data:
          $ref: '#/components/schemas/ApiRouteRequestAdditionalData'
    ApiTonStakingTransactionRequest:
      type: object
      required:
        - sender_address
        - amount
        - token_address
      properties:
        referral_name:
          type: string
          example: "tonkeeper"
        sender_address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        amount:
          type: number
          format: double
          example: 0.05
        token_address:
          type: string
          example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
    ApiTransactionsCustomFee:
      type: object
      description: If present, additional transaction for fees collection will be generated. Because of that, be careful with max_splits to not exceed wallet contract limits
      properties:
        fixed_fee:
          type: string
          description: Value in nanotons
        percentage_fee:
          type: integer
          description: "Value in 1/1000000: 1 is 0.0001%, 1000000 is 100%. If present, can not be less than 10000000 (0.01 TON)"
        min_percentage_fee_fixed:
          type: string
          description: Value in nanotons. No less than this value may be withdrawn as a percentage_fee. Must be set if percentage_fee is present. Can not be less than 10000000 (0.01 TON)
        max_percentage_fee_fixed:
          type: string
          description: Value in nanotons. If set, no more than this value may be withdrawn as a percentage_fee. Taken into account only if percentage_fee is present
    ApiTransactionsRequest:
      type: object
      required:
        - sender_address
        - paths
      properties:
        sender_address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        slippage:
          type: number
          format: double
          description: If the slippage is exceeded, the transaction will not be executed and intermediate tokens will be returned to the sender.
          minimum: 0
          maximum: 1
          example: 0.05
        dynamic_slippage:
          type: boolean
          description: If set to true, slippage will be calculated dynamically.
          default: false
          example: true
        referral_name:
          type: string
          description: May be set whilst building transactions from B2B partnership products
          example: "tonkeeper"
        custom_fee:
          $ref: '#/components/schemas/ApiTransactionsCustomFee'
        mev_protection:
          type: boolean
          description: Whether a MEV protection should be enabled
          example: true
        paths:
          type: array
          description: Value of this field is a response from route building endpoint
          items:
            $ref: '#/components/schemas/ApiRoutingStep'
    ApiQuantifiedToken:
      type: object
      required:
        - token_blockchain
        - token_address
        - amount
      properties:
        token_blockchain:
          type: string
          example: ton
        token_address:
          type: string
        amount:
          type: number
          format: double
    ApiTransactionStepStatus:
      type: string
      enum:
        - pending
        - cancelled
        - succeeded
        - failed
        - timed_out
    ApiTransactionStepResult:
      type: object
      required:
        - status
      properties:
        status:
          $ref: '#/components/schemas/ApiTransactionStepStatus'
        input:
          $ref: '#/components/schemas/ApiQuantifiedToken'
        output:
          $ref: '#/components/schemas/ApiQuantifiedToken'
    ApiTransactionStatus:
      type: string
      enum:
        - pending
        - partially_complete
        - succeeded
        - failed
        - timed_out
    ApiTransactionResult:
      type: object
      required:
        - status
        - steps
      properties:
        status:
          $ref: '#/components/schemas/ApiTransactionStatus'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/ApiTransactionStepResult'
        input:
          $ref: '#/components/schemas/ApiQuantifiedToken'
        output:
          $ref: '#/components/schemas/ApiQuantifiedToken'
    ApiTokenWithAmount:
      type: object
      required:
        - token
        - amount
      properties:
        token:
          $ref: '#/components/schemas/ApiToken'
        amount:
          type: number
    ApiSplitStepResult:
      type: object
      required:
        - status
      properties:
        status:
          $ref: '#/components/schemas/ApiTransactionStepStatus'
        input:
          $ref: '#/components/schemas/ApiTokenWithAmount'
        output:
          $ref: '#/components/schemas/ApiTokenWithAmount'
    ApiSplitResult:
      type: object
      required:
        - status
        - steps
        - paid
        - gas_sent
      properties:
        status:
          $ref: '#/components/schemas/ApiTransactionStatus'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/ApiSplitStepResult'
        input:
          $ref: '#/components/schemas/ApiTokenWithAmount'
        output:
          $ref: '#/components/schemas/ApiTokenWithAmount'
        paid:
          type: boolean
          description: Whether funds were paid from the pools to their receiver
        gas_sent:
          type: number
          description: Amount of nanotons, dedicated to be spent on gas
        gas_received:
          type: number
          description: Amount of nanotons, dedicated to be spent on gas, that have been returned. Present only when paid is true
    ApiRouteResult:
      type: object
      required:
        - splits
        - terminal
      properties:
        splits:
          type: array
          items:
            $ref: '#/components/schemas/ApiSplitResult'
        terminal:
          type: boolean
          description: Whether this is the final view of the route result (i.e. it won't change anymore) and therefore it will be invalidated from our cache soon
    ApiAuthTokenOption:
      type: string
      enum:
        - administrator
        - moderator
        - allow_cycles
        - extended_tx_status
        - paid
    ApiCreateAuthTokenRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 32
        hourly_limit:
          type: integer
        options:
          type: array
          items:
            $ref: '#/components/schemas/ApiAuthTokenOption'
    ApiEditAuthTokenRequest:
      type: object
      required:
        - token
      properties:
        token:
          type: string
        name:
          type: string
          minLength: 1
          maxLength: 32
        hourly_limit:
          type: integer
        options:
          type: array
          items:
            $ref: '#/components/schemas/ApiAuthTokenOption'
    ApiAuthToken:
      type: object
      required:
        - token
        - name
      properties:
        token:
          type: string
        name:
          type: string
        hourly_limit:
          type: integer
        options:
          type: array
          items:
            $ref: '#/components/schemas/ApiAuthTokenOption'
    ApiHistoricalTransaction:
      type: object
      required:
        - route_id
        - unix_time
        - logical_time
        - from
        - to
        - dex
      properties:
        route_id:
          type: integer
        unix_time:
          type: integer
          format: int64
          description: When transaction happened in blockchain - unix seconds
        logical_time:
          type: integer
          format: int64
          description: When transaction happened in blockchain - on-chain logical time
        from:
          $ref: '#/components/schemas/ApiQuantifiedToken'
        to:
          $ref: '#/components/schemas/ApiQuantifiedToken'
        dex:
          type: string
          example: stonfi
    ApiReferralAccountReward:
      type: object
      required:
        - volume
        - fees
      properties:
        volume:
          type: number
          format: double
        fees:
          type: number
          format: double
    ApiReferralAccountRewards:
      type: object
      required:
        - monthly
        - total
      properties:
        monthly:
          $ref: '#/components/schemas/ApiReferralAccountReward'
        total:
          $ref: '#/components/schemas/ApiReferralAccountReward'
    ApiReferralAccountInfo:
      type: object
      required:
        - link
        - level
        - fees_percentage
        - referrals_count
        - transactions_count
        - rewards
      properties:
        link:
          type: string
        level:
          type: integer
        fees_percentage:
          type: number
          format: double
        referrals_count:
          type: integer
        transactions_count:
          type: integer
          description: Number of transactions sent by referral users
        rewards:
          $ref: '#/components/schemas/ApiReferralAccountRewards'
    ApiReferralAccountInfoUpdate:
      type: object
      required:
        - fees_percentage
      properties:
        fees_percentage:
          type: number
          format: double
    ApiReferralInfo:
      type: object
      required:
        - address
        - transactions_count
        - rewards
      properties:
        address:
          type: string
        transactions_count:
          type: integer
        rewards:
          $ref: '#/components/schemas/ApiReferralAccountReward'
    ApiClaimingType:
      type: string
      enum:
        - all
        - referral
        - cashback
        - staking
        - rewards_stonfi
        - rewards_dedust
        - coffee_dex
        - boost
    ApiClaimingTypeStats:
      type: object
      required:
        - type
        - available_usd
      properties:
        type:
          $ref: '#/components/schemas/ApiClaimingType'
        available_usd:
          type: number
          format: double
    ApiClaimingTokenStats:
      type: object
      required:
        - token
        - wallet
        - type
        - claimed
        - locked
        - available
        - available_usd
      properties:
        token:
          $ref: '#/components/schemas/ApiToken'
        wallet:
          type: string
          description: Wallet's address where token resides
        type:
          $ref: '#/components/schemas/ApiClaimingType'
        claimed:
          type: string
          format: int128
        locked:
          type: string
          format: int128
        available:
          type: string
          format: int128
        available_usd:
          type: number
          format: double
    ApiClaimingStats:
      type: object
      required:
        - aggregated
        - detailed
      properties:
        aggregated:
          type: array
          items:
            $ref: '#/components/schemas/ApiClaimingTypeStats'
        detailed:
          type: array
          items:
            $ref: '#/components/schemas/ApiClaimingTokenStats'
    ApiTokenClaimRequest:
      type: object
      required:
        - token_address
        - wallet_address
      properties:
        token_address:
          type: string
        wallet_address:
          type: string
    ApiClaimTransferRequest:
      type: object
      required:
        - from
        - to
        - type
        - tokens
      properties:
        from:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        to:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        type:
          $ref: '#/components/schemas/ApiClaimingType'
        tokens:
          type: array
          items:
            type: string
            example: EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
    ApiTransactionResponse:
      type: object
      required:
        - query_id
        - message
      properties:
        query_id:
          type: integer
          format: int64
        message:
          $ref: '#/components/schemas/ApiTransactionBoc'
    ApiWithdrawalType:
      type: string
      enum:
        - repay
        - refund
    ApiWithdrawalStatus:
      type: string
      enum:
        - unhandled
        - processing
        - processed
    ApiWithdrawal:
      type: object
      required:
        - type
        - status
      properties:
        type:
          $ref: '#/components/schemas/ApiWithdrawalType'
        status:
          $ref: '#/components/schemas/ApiWithdrawalStatus'
    ApiClaimState:
      type: object
      required:
        - type
        - query_id
        - unix_time
        - logical_time
        - transaction_hash
        - token_address
        - wallet_address
        - amount
        - withdrawal
      properties:
        type:
          $ref: '#/components/schemas/ApiClaimingType'
        query_id:
          type: integer
          format: int64
        unix_time:
          type: integer
          format: int64
          description: When transaction happened in blockchain - unix seconds
        logical_time:
          type: integer
          format: int64
          description: When transaction happened in blockchain - on-chain logical time
        transaction_hash:
          type: string
        token_address:
          type: string
        wallet_address:
          type: string
        amount:
          type: number
        withdrawal:
          $ref: '#/components/schemas/ApiWithdrawal'
    ApiClaimStateResponse:
      type: object
      required:
        - total_count
        - items
      properties:
        total_count:
          type: integer
        items:
          type: array
          items:
            $ref: '#/components/schemas/ApiClaimState'
    ApiTonProof:
      type: object
      required:
        - timestamp
        - domain_len
        - domain_val
        - payload
        - signature
      properties:
        timestamp:
          type: integer
          format: int64
          description: Valid till, in seconds
        domain_len:
          type: integer
          format: int64
        domain_val:
          type: string
        payload:
          type: string
        signature:
          type: string
    ApiProofValidationRequest:
      type: object
      required:
        - public_key
        - wallet_state_init
        - proof
      properties:
        public_key:
          type: string
        wallet_state_init:
          type: string
          format: base64
          description: Base64-encoded initial state. Must be retrieved from ton-connect.
        proof:
          $ref: '#/components/schemas/ApiTonProof'
    ApiJson:
      type: object
      additionalProperties: { }
    ApiContentReference:
      type: object
      required:
        - ref_name
        - ref_url
      properties:
        ref_name:
          type: string
        ref_url:
          type: string
    ApiCashbackLimitCreateRequest:
      type: object
      required:
        - interval_duration_seconds
        - max_distribute_at_interval
      properties:
        interval_duration_seconds:
          type: integer
          format: int64
        max_distribute_at_interval:
          type: number
    ApiDexSwapConditionType:
      type: string
      enum:
        - unique
        - listed
        - partner_address
        - tokens
        - tokens-pair
        - tokens-exact
        - users-whitelist
        - swap-tx-min-amount
        - blacklist-pair
        - blacklist-tokens
        - dexes
    ApiDexSwapCondition:
      type: object
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/ApiDexSwapConditionType'
        args:
          description: Arguments required to construct condition type
          type: array
          items:
            type: string
    ApiCashbackCreateRequest:
      type: object
      required:
        - title
        - description
        - distributor
        - reward_token
        - conditions
        - distribute
        - distributed
        - start_time_seconds
        - end_time_seconds
        - is_hidden
        - reward_denominator
        - limits
        - image_url
        - references
        - dexes
      properties:
        title:
          type: string
        description:
          type: string
        distributor:
          type: string
          description: Where rewards stored
          example: EQCZ_pV6EJNSr6XpvPaa-IVkT6ImqkiPftRMOICJP1B_75wZ
        reward_token:
          type: string
          example: EQCZ_pV6EJNSr6XpvPaa-IVkT6ImqkiPftRMOICJP1B_75wZ
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ApiDexSwapCondition'
        distribute:
          type: number
          description: How many tokens will be distributed to users
        distributed:
          type: number
          description: How many tokens already distributed to users
        start_time_seconds:
          type: integer
          format: int64
          description: Begin cashback promo in unix seconds
        end_time_seconds:
          type: integer
          format: int64
          description: End cashback promo in unix seconds
        reward_denominator:
          type: number
        is_hidden:
          type: boolean
        limits:
          type: array
          items:
            $ref: '#/components/schemas/ApiCashbackLimitCreateRequest'
        image_url:
          type: string
        references:
          type: array
          items:
            $ref: '#/components/schemas/ApiContentReference'
    ApiCashbackLimitUpdateRequest:
      type: object
      properties:
        limit_id:
          type: integer
          format: int64
        interval_duration_seconds:
          type: integer
          format: int64
        max_distribute_at_interval:
          type: number
    ApiCashbackUpdateRequest:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        distributor:
          type: string
          description: Where rewards stored
          example: EQCZ_pV6EJNSr6XpvPaa-IVkT6ImqkiPftRMOICJP1B_75wZ
        reward_token:
          type: string
          example: EQCZ_pV6EJNSr6XpvPaa-IVkT6ImqkiPftRMOICJP1B_75wZ
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ApiDexSwapCondition'
        distribute:
          type: number
          description: How many tokens will be distributed to users
        distributed:
          type: number
          description: How many tokens already distributed to users
        start_time_seconds:
          type: integer
          format: int64
          description: Begin cashback promo in unix seconds
        end_time_seconds:
          type: integer
          format: int64
          description: End cashback promo in unix seconds
        reward_denominator:
          type: number
        is_hidden:
          type: boolean
        limits:
          type: array
          items:
            $ref: '#/components/schemas/ApiCashbackLimitUpdateRequest'
        image_url:
          type: string
        references:
          type: array
          items:
            $ref: '#/components/schemas/ApiContentReference'
    ApiCashbackLimit:
      type: object
      required:
        - limit_id
        - interval_duration_seconds
        - max_distribute_at_interval
      properties:
        limit_id:
          type: integer
          format: int64
        interval_duration_seconds:
          type: integer
          format: int64
        max_distribute_at_interval:
          type: number
    ApiCashbackInfo:
      type: object
      required:
        - id
        - title
        - description
        - distributor
        - reward_token
        - conditions
        - distribute
        - distributed
        - start_time_seconds
        - end_time_seconds
        - reward_denominator
        - is_hidden
        - is_active
        - limits
        - image_url
        - references
      properties:
        id:
          type: integer
          format: int64
        title:
          type: string
        description:
          type: string
        distributor:
          type: string
          description: Where rewards stored
          example: EQCZ_pV6EJNSr6XpvPaa-IVkT6ImqkiPftRMOICJP1B_75wZ
        reward_token:
          type: string
          example: EQCZ_pV6EJNSr6XpvPaa-IVkT6ImqkiPftRMOICJP1B_75wZ
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ApiDexSwapCondition'
        distribute:
          type: number
          description: How many tokens will be distributed to users
        distributed:
          type: number
          description: How many tokens already distributed to users
        start_time_seconds:
          type: integer
          format: int64
          description: Begin cashback promo in unix seconds
        end_time_seconds:
          type: integer
          format: int64
          description: End cashback promo in unix seconds
        reward_denominator:
          type: number
        is_active:
          type: boolean
          description: Can this cashback program accrue tokens to participants
        limits:
          type: array
          items:
            $ref: '#/components/schemas/ApiCashbackLimit'
        image_url:
          type: string
        references:
          type: array
          items:
            $ref: '#/components/schemas/ApiContentReference'
        is_hidden:
          type: boolean
    ApiCashbackInfoResponse:
      type: object
      required:
        - infos
        - count
      properties:
        count:
          type: integer
          description: Total amount of similar cashback promos
        infos:
          type: array
          items:
            $ref: '#/components/schemas/ApiCashbackInfo'
    ApiUserCashbackInfo:
      type: object
      required:
        - cashback_id
        - earned_usd
      properties:
        cashback_id:
          type: integer
          format: int64
        earned_usd:
          type: number
          format: double
    ApiUserCashbackInfoTotal:
      type: object
      required:
        - cashback_count
        - total_earned_usd
      properties:
        cashback_count:
          type: integer
        total_earned_usd:
          type: number
          format: double
      additionalProperties: { }
    ApiContestReward:
      type: object
      required:
        - reward
      properties:
        reward:
          type: string
        place:
          type: integer
          format: int32
        place_from:
          type: integer
          format: int32
        place_to:
          type: integer
          format: int32
    ApiContestInfo:
      type: object
      required:
        - title
        - description
        - references
        - conditions
        - rewards
        - start_time_unix
        - end_time_unix
        - image_url
        - total_reward
        - hidden
      properties:
        title:
          type: string
        description:
          type: string
        references:
          type: array
          items:
            $ref: '#/components/schemas/ApiContentReference'
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ApiDexSwapCondition'
        rewards:
          type: array
          items:
            $ref: '#/components/schemas/ApiContestReward'
        start_time_unix:
          type: integer
          format: int64
          description: in seconds
        end_time_unix:
          type: integer
          format: int64
          description: in seconds
        image_url:
          type: string
        total_reward:
          type: string
        hidden:
          type: boolean
    ApiContestInfoWithID:
      type: object
      required:
        - id
        - info
      properties:
        id:
          type: integer
          format: int32
        info:
          $ref: '#/components/schemas/ApiContestInfo'
    ApiContestUserStats:
      type: object
      required:
        - address
        - position
        - volume_usd
      properties:
        address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        position:
          type: integer
          format: int32
        volume_usd:
          type: number
          format: double
    ApiContestTopStats:
      type: array
      items:
        $ref: '#/components/schemas/ApiContestUserStats'
    ApiContestTokenPayoutInfo:
      type: object
      required:
        - distributor
        - token
      properties:
        distributor:
          type: string
          example: UQD_gZghWHqB7TGFTSs0FjrpL5dlUH5lznJHPHMpiwNldyPc
        token:
          $ref: '#/components/schemas/ApiTokenAddress'
        entries:
          type: array
          items:
            $ref: '#/components/schemas/ApiContestTokenPayoutEntry'
        random:
          $ref: '#/components/schemas/ApiContestTokenPayoutRandoms'
    ApiContestTokenPayoutEntry:
      type: object
      required:
        - place_from
        - place_to
        - token_amount
      properties:
        place_from:
          type: integer
          format: int32
        place_to:
          type: integer
          format: int32
        token_amount:
          type: number
          format: double
    ApiContestTokenPayoutRandoms:
      type: object
      required:
        - count
        - token_amount
        - min_volume_usd
      properties:
        count:
          type: integer
          format: int32
        token_amount:
          type: number
          format: double
        min_volume_usd:
          type: number
          format: double
    ApiContestTokenPayoutAccrual:
      type: object
      required:
        - address
        - amount
        - volume_usd
        - reason
      properties:
        address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        amount:
          type: number
          format: double
        volume_usd:
          type: number
          format: double
        reason:
          type: string
          example: "place #1"
    ApiRawTransactionRecord:
      type: object
      required:
        - query_id
        - route_id
        - timestamp
        - hash
        - lt
        - user_wallet
        - token_from
        - token_to
        - amount_from
        - amount_from_usd
        - amount_to
        - amount_to_usd
        - dex
        - ref_fee_usd
        - failed
        - suspicious
      properties:
        query_id:
          type: integer
          format: int64
        route_id:
          type: integer
          format: int32
        timestamp:
          type: integer
          format: int64
        hash:
          type: string
        lt:
          type: integer
          format: int64
        user_wallet:
          type: string
        token_from:
          type: string
        token_to:
          type: string
        amount_from:
          type: number
          format: double
        amount_from_usd:
          type: number
          format: double
        amount_to:
          type: number
          format: double
        amount_to_usd:
          type: number
          format: double
        dex:
          type: string
        ref_fee_usd:
          type: number
          format: double
        failed:
          type: boolean
        suspicious:
          type: boolean
    ApiTxStats:
      type: object
      required:
        - count
        - volume
        - fees
      properties:
        count:
          type: integer
          format: int32
        volume:
          type: number
          format: double
        fees:
          type: number
          format: double
    ApiCreateStakeRequest:
      type: object
      required:
        - asset_address
        - amount_to_stake_raw
        - period_id
      properties:
        asset_address:
          type: string
          description: Token to be staked.
          example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
        amount_to_stake_raw:
          type: number
        period_id:
          type: integer
          format: int32
          description: Lock identifier.
    ApiExtendStakeRequest:
      type: object
      required:
        - period_id
      properties:
        period_id:
          type: integer
          format: int32
          description: Lock identifier.
    ApiStakingPositionPeriods:
      type: object
      required:
        - period_id
        - percentage
        - lock_duration
      properties:
        period_id:
          type: integer
          format: int32
          description: Period id, to be passed into protocol.
        percentage:
          type: integer
          format: int64
          description: How much additional points will be accrued.
        lock_duration:
          type: integer
          format: int64
          description: How much wait till position unlock.
    ApiStakingTokenInfo:
      type: object
      required:
        - token_address
        - asset_raw
        - asset_usd
      properties:
        token_address:
          type: string
          description: Reward token address.
          example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
        asset_usd:
          type: number
          format: double
        asset_raw:
          type: number
    ApiStakingTokenInfoLock:
      type: object
      required:
        - token
        - normalizer
        - price_per_token_usd
      properties:
        token:
          description: Token to be staked for rewards.
          $ref: '#/components/schemas/ApiToken'
        normalizer:
          type: number
        price_per_token_usd:
          type: number
          format: double
    ApiStakingPositionInfo:
      type: object
      required:
        - id
        - locked_asset_address
        - locked_asset_amount_raw
        - locked_native
        - locked_usd
        - start_lock_seconds_utc
        - end_lock_seconds_utc
        - points_amount
        - period_id
        - available_periods # how can extend stake
        - earned_rewards # per notify reward
      properties:
        id:
          type: integer
          format: int64
        locked_asset_address:
          type: string
          description: Staked token
          example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
        locked_asset_amount_raw:
          description: Staked token amount in raw
          type: number
        locked_native:
          description: Staked token volume converted to main staking token
          type: number
        locked_usd:
          type: number
          format: double
        start_lock_seconds_utc:
          type: integer
          format: int64
        end_lock_seconds_utc:
          type: integer
          format: int64
        points_amount:
          type: number
        period_id:
          type: integer
          format: int32
        available_periods:
          type: array
          items:
            $ref: '#/components/schemas/ApiStakingPositionPeriods'
        earned_rewards:
          type: array
          items:
            $ref: '#/components/schemas/ApiStakingTokenInfo'
    ApiStakingRewardsTokenInfo:
      type: object
      required:
        - token_address
        - end_distribution_unix
        - reward_rate
      properties:
        token_address:
          type: string
          description: Token address.
          example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
        end_distribution_unix:
          type: integer
          format: int64
          description: Timestamp in unix seconds
        reward_rate:
          type: number
    ApiStakingInfo:
      type: object
      required:
        - name
        - master_address
      properties:
        name:
          type: string
        master_address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
    ApiStakingGlobalInfo:
      type: object
      required:
        - total_points
        - apr
        - total_locked_native
        - locked_tokens
        - distributed_rewards
        - actual_rewards
        - periods
      properties:
        total_points:
          type: number
        apr:
          type: number
          format: double
        total_locked_native:
          type: number
        locked_tokens:
          type: array
          items:
            $ref: '#/components/schemas/ApiStakingTokenInfoLock'
        distributed_rewards:
          type: array
          items:
            $ref: '#/components/schemas/ApiStakingTokenInfo'
        actual_rewards:
          type: array
          items:
            $ref: '#/components/schemas/ApiStakingRewardsTokenInfo'
        periods:
          type: array
          items:
            $ref: '#/components/schemas/ApiStakingPositionPeriods'
        calculated_at_time:
          type: integer
          format: int64
    ApiStakingUserInfo:
      type: object
      required:
        - total_points
        - locked_tokens
        - paid_rewards
        - positions
      properties:
        total_points:
          type: number
        locked_tokens:
          type: array
          items:
            $ref: '#/components/schemas/ApiStakingTokenInfo'
        paid_rewards:
          type: array
          items:
            $ref: '#/components/schemas/ApiStakingTokenInfo'
        positions:
          type: array
          items:
            $ref: '#/components/schemas/ApiStakingPositionInfo'
    ApiUserPoints:
      type: object
      required:
        - points
      properties:
        points:
          type: number
    ApiUserStakeTokenInfo:
      type: object
      required:
        - asset_address
        - asset_amount_raw
        - asset_amount_usd
      properties:
        asset_address:
          type: string
          description: Token address.
          example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
        asset_amount_raw:
          type: number
        asset_amount_usd:
          type: number
          format: double
    ApiStrategyOrderType:
      type: string
      enum:
        - limit
        - dca
        - vca
    ApiStrategyOrderStatus:
      type: string
      enum:
        - active
        - requested_cancellation
        - cancelled_by_user
        - cancelled_by_system
        - executed
        - max_retries_exceeded
    ApiStrategyOrder:
      type: object
      required:
        - id
        - type
        - wallet
        - status
        - creation_timestamp
        - token_from
        - token_to
        - initial_input_amount
        - current_input_amount
        - settings
        - current_output_amount
        - max_suborders
        - suborders_executed
        - max_invocations
        - invocations_executed
        - slippage
        - max_path_length
        - active_transactions
      properties:
        id:
          type: integer
          format: int32
        type:
          $ref: '#/components/schemas/ApiStrategyOrderType'
        wallet:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        status:
          $ref: '#/components/schemas/ApiStrategyOrderStatus'
        creation_timestamp:
          type: integer
          format: int64
          description: Unix time in seconds
        token_from:
          $ref: '#/components/schemas/ApiToken'
        token_to:
          $ref: '#/components/schemas/ApiToken'
        initial_input_amount:
          type: string
        current_input_amount:
          type: string
        settings:
          $ref: '#/components/schemas/ApiJson'
        current_output_amount:
          type: string
        max_suborders:
          type: integer
          format: int32
        suborders_executed:
          type: integer
          format: int32
        max_invocations:
          type: integer
          format: int32
          description: Max amount of swaps to be potentially executed (including those that fail to reasons like slippage tolerance abortion)
        invocations_executed:
          type: integer
          format: int32
          description: Amount of swaps that had already been tried to be executed (including those that failed to reasons like slippage tolerance abortion)
        slippage:
          type: number
          format: double
          minimum: 0.001
          maximum: 1
        max_path_length:
          type: integer
          format: int32
          description: Max path length in tokens for every route that could potentially be executed within this order
        active_transactions:
          type: integer
          format: int32
          description: Amount of this order transactions that were sent, but their result is still unknown
        close_timestamp:
          type: integer
          format: int64
          description: Unix time in seconds
    ApiStrategyOrderCreationRequest:
      type: object
      required:
        - type
        - token_from
        - token_to
        - input_amount
        - settings
        - max_suborders
        - max_invocations
        - slippage
      properties:
        type:
          $ref: '#/components/schemas/ApiStrategyOrderType'
        token_from:
          $ref: '#/components/schemas/ApiTokenAddress'
        token_to:
          $ref: '#/components/schemas/ApiTokenAddress'
        input_amount:
          type: string
        settings:
          $ref: '#/components/schemas/ApiJson'
        max_suborders:
          type: integer
          format: int32
          minimum: 1
          maximum: 255
        max_invocations:
          type: integer
          format: int32
          description: Max amount of swaps to be potentially executed (including those that fail to reasons like slippage tolerance abortion)
          minimum: 1
          maximum: 255
        slippage:
          type: number
          format: double
          minimum: 0
          maximum: 1
        referral_name:
          type: string
          description: May be set whilst building transactions from B2B partnership products
          example: "tonkeeper"
    ApiReferralSetAliasRequest:
      type: object
      required:
        - address
      properties:
        address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
    ApiDexPoolCreationRequest:
      type: object
      required:
        - user_wallet
        - asset_1
        - asset_2
        - asset_1_amount
        - asset_2_amount
      properties:
        user_wallet:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        asset_1:
          type: string
          example: native
        asset_2:
          type: string
          example: EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
        asset_1_amount:
          type: string
          description: Absolute value
        asset_2_amount:
          type: string
          description: Absolute value
    ApiDexPoolCreationResponse:
      type: object
      required:
        - transactions
      properties:
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/ApiTransactionResponse'
    ApiDexPoolLiquidityProvisioningReservesRatioCondition:
      type: object
      required:
        - denominator
        - min_nominator
        - max_nominator
      properties:
        denominator:
          type: integer
          format: int32
        min_nominator:
          type: integer
          format: int32
        max_nominator:
          type: integer
          format: int32
    ApiDexPoolLiquidityProvisioningRequest:
      type: object
      required:
        - user_wallet
        - asset_1_amount
        - asset_2_amount
      properties:
        user_wallet:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        asset_1_amount:
          type: string
          description: Absolute value
        asset_2_amount:
          type: string
          description: Absolute value
        min_lp_amount:
          type: string
          description: Absolute value
        reserves_ratio_condition:
          $ref: '#/components/schemas/ApiDexPoolLiquidityProvisioningReservesRatioCondition'
    ApiDexPoolLiquidityWithdrawalRequest:
      type: object
      required:
        - user_address
        - lp_amount
      properties:
        user_address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        lp_amount:
          type: string
          description: Absolute value
    ApiDexCLMMPoolLiquidityProvisioningRequest:
      type: object
      required:
        - asset_1_amount_desired
        - asset_2_amount_desired
        - asset_1_amount_to_send
        - asset_2_amount_to_send
        - lp_amount
        - tick_lower
        - tick_upper
      properties:
        asset_1_amount_desired:
          type: string
          description: Absolute value
        asset_2_amount_desired:
          type: string
          description: Absolute value
        asset_1_amount_to_send:
          type: string
          description: Absolute value
        asset_2_amount_to_send:
          type: string
          description: Absolute value
        lp_amount:
          type: string
          description: Absolute value
        tick_lower:
          type: integer
          format: int64
        tick_upper:
          type: integer
          format: int64
    ApiDexCLMMPoolLiquidityWithdrawalRequest:
      type: object
      required:
        - lp_amount
        - position_id
        - tick_lower
        - tick_upper
      properties:
        lp_amount:
          type: string
          description: Absolute value
        tick_lower:
          type: integer
          format: int64
        tick_upper:
          type: integer
          format: int64
        position_id:
          type: integer
          format: int64
          description: Position id, used for interaction with CLMM protocol
    ApiDexDLMMPoolLiquidityProvisioningRequest:
      type: object
      required:
        - asset_1_amount
        - asset_2_amount
        - shape_type
        - bin_from
        - bin_to
      properties:
        asset_1_amount:
          type: string
          description: Amount of first token to provide
        asset_2_amount:
          type: string
          description: Amount of second token to provide
        shape_type:
          type: string
          enum: [ curve, spot, bidask ]
          description: Shape type for liquidity distribution
        bin_from:
          type: integer
          format: int32
          description: Starting bin index for liquidity provision, inclusive
        bin_to:
          type: integer
          format: int32
          description: Ending bin index for liquidity provision, inclusive
        fallback_ratio:
          type: number
          format: double
          description: Fallback ratio for liquidity distribution (0-1)
          minimum: 0
          maximum: 1
    ApiDexDLMMLiquidityWithdrawalRequest:
      type: object
      required:
        - burn_all
      properties:
        burn_all:
          type: boolean
          default: true
          description: Whether to burn all liquidity from position. If true, `bins_to_burn` is ignored
        bins_to_burn:
          type: object
          additionalProperties:
            type: string
          description: Map of bin index to LP amount to burn
    ApiPartnerSettings:
      type: object
      required:
        - ref_share
        - custom_fee
      properties:
        ref_share:
          type: number
          format: double
        custom_fee:
          $ref: '#/components/schemas/ApiTransactionsCustomFee'
    ApiBoostPoolApr:
      type: object
      required:
        - apr
      properties:
        apr:
          type: number
          description: Apr percentage
    ApiBoost:
      type: object
      required:
        - pool_address
        - reward_token
        - reward_rate_per_second
        - finish_seconds_unix
        - rewards_per_day_usd
        - apr
      properties:
        pool_address:
          type: string
        boost_factory:
          type: string
        boost_id:
          type: integer
          format: int64
        reward_token:
          $ref: '#/components/schemas/ApiToken'
        reward_rate_per_second:
          type: string
        start_seconds_unix:
          type: integer
          format: int64
        finish_seconds_unix:
          type: integer
          format: int64
        rewards_per_day_usd:
          type: number
        apr:
          type: number
          description: Apr in percents
        lock_duration_seconds:
          type: integer
          format: int64
        excluded_addresses:
          type: array
          items:
            type: string
    ApiCreateBoostRequest:
      type: object
      required:
        - pool_address
        - start_seconds
        - finish_seconds
        - amount_raw
        - reward_token
        - exclude_addresses
      properties:
        pool_address:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        start_seconds:
          type: integer
          format: int64
        finish_seconds:
          type: integer
          format: int64
        amount_raw:
          type: string
          description: Absolute value
        reward_token:
          type: string
        exclude_addresses:
          type: array
          items:
            type: string
    ApiBoostAggregated:
      type: object
      required:
        - infos
        - count
      properties:
        count:
          type: integer
          description: Total amount of boosts
        infos:
          type: array
          items:
            $ref: '#/components/schemas/ApiBoost'
    ApiUserBoost:
      type: object
      required:
        - reward_token
        - earned_amount_native
        - earned_amount_usd
        - end_at_utc_seconds
      properties:
        reward_token:
          $ref: '#/components/schemas/ApiToken'
        earned_amount_native:
          type: string
        earned_amount_usd:
          type: number
        end_at_utc_seconds:
          type: number
          format: int64
        nft_address:
          type: string
    ApiLpMigrationPoolAction:
      type: string
      enum:
        - not_existing_pool
        - existing_pool
    ApiTxOperationStatus:
      type: string
      enum:
        - pending

        - partially_complete
        - request_confirmed
        - second_stage_started
        - refund

        - succeeded
        - failed
        - timed_out
    ApiLpMigrationUserPoolInfo:
      type: object
      required:
        - pool
        - total_lp_amount
        - user_lp_amount
      properties:
        pool:
          $ref: '#/components/schemas/ApiPool'
        total_lp_amount:
          type: string
          description: Absolute value
        user_lp_amount:
          type: string
          description: Absolute value
    ApiLpMigrationPoolDestination:
      type: object
      required:
        - pool_action_type
        - total_lp_amount
        - amm_type
        - tokens
        - reserves
      properties:
        pool_address:
          type: string
        total_lp_amount:
          type: string
          description: Absolute value
        amm_type:
          $ref: '#/components/schemas/ApiAmmType'
        tokens:
          type: array
          items:
            $ref: '#/components/schemas/ApiToken'
        reserves:
          $ref: '#/components/schemas/ApiPoolReserves'
        pool_action_type:
          $ref: '#/components/schemas/ApiLpMigrationPoolAction'
        amm_settings:
          $ref: '#/components/schemas/ApiJson'
    ApiLpMigrationUserRequest:
      type: object
      required:
        - source_pool
        - source_lp
        - min_destination_lp
        - pool_action_type
      properties:
        source_pool:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        destination_pool:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
          description: If not passed, then volatile pool with source pool tokens will be created
        source_lp:
          type: string
          description: Absolute value
        min_destination_lp:
          type: string
          description: Absolute value
        pool_action_type:
          $ref: '#/components/schemas/ApiLpMigrationPoolAction'
    ApiSupportedBlockchain:
      type: string
      enum:
        - ton
    ApiSupportedYields:
      type: string
      enum:
        - stonfi
        - dedust
        - dedust_v2
        - stonfi_v2
        - coffee
        - tonraffles
        - tonco
        - tonco_v2
        - colossus
        - bidask
        - tonstakers
        - bemo
        - bemo_v2
        - hipo
        - torch_finance
        - stakee
        - kton
        - evaa
        - coffin
        - moon
        - storm_trade
        - farmix_lending
        - dao_lama_vault
    ApiPoolStatistics:
      type: object
      required:
        - address
        - tvl_usd
        - volume_usd
        - fee_usd
        - apr
        - lp_apr
        - boost_apr
      properties:
        # todo: remove address
        address:
          type: string
        tvl_usd:
          type: number
          format: double
        volume_usd:
          type: number
          format: double
        fee_usd:
          type: number
          format: double
        apr:
          type: number
          format: double
        lp_apr:
          type: number
          format: double
        boost_apr:
          type: number
          format: double
        locked_asset_amount:
          type: string
    ApiPoolInfo:
      type: object
      required:
        - pool
        - info
      properties:
        pool:
          $ref: '#/components/schemas/ApiPool'
        info:
          $ref: '#/components/schemas/ApiPoolStatistics'
    ApiPoolsSearchResponse:
      type: object
      required:
        - pools
        - total_count
      properties:
        total_count:
          type: integer
          format: int32
        pools:
          type: array
          items:
            $ref: '#/components/schemas/ApiPoolInfo'
    ApiUserPoolLpResponse:
      type: object
      required:
        - total_lp_amount
        - user_lp_amount
        - user_lp_wallet
      properties:
        total_lp_amount:
          type: string
        user_lp_amount:
          type: string
        user_lp_wallet:
          type: string
    ApiSortOrder:
      type: string
      enum:
        - ASC
        - DESC
    ApiPoolSortOrder:
      type: string
      enum:
        - tvl
        - volume
        - apr
    ApiStonfiFarmRequest:
      type: object
      required:
        - lp_amount
        - minter_address
      properties:
        lp_amount:
          type: string
        minter_address:
          type: string
    ApiExternalStatus:
      type: string
      enum:
        - pending
        - succeeded
        - failed
    ApiStrategyWalletPayout:
      type: object
      required:
        - address
        - entries
      properties:
        address:
          type: string
        entries:
          type: array
          items:
            $ref: '#/components/schemas/ApiStrategyWalletPayoutEntry'
    ApiStrategyWalletPayoutEntry:
      type: object
      required:
        - token
        - amount
      properties:
        token:
          type: string
          example: native
        amount:
          type: string
          description: Absolute value
    ApiTokenPricesRequest:
      type: object
      required:
        - blockchain
        - addresses
      properties:
        blockchain:
          $ref: '#/components/schemas/ApiSupportedBlockchain'
        addresses:
          type: array
          items:
            type: string
    ApiTokenPriceEntry:
      type: object
      required:
        - address
        - usd_price
      properties:
        address:
          type: string
        usd_price:
          type: number
          format: double
    ApiYieldBriefPool_Dex:
      type: object
      required:
        - amm_type
      properties:
        amm_type:
          $ref: '#/components/schemas/ApiAmmType'
    ApiYieldPool:
      type: object
      required:
        - address
        - protocol
        - is_trusted
        - tokens
        - pool_statistics
      properties:
        address:
          type: string
        protocol:
          $ref: '#/components/schemas/ApiSupportedYields'
        is_trusted:
          type: boolean
        tokens:
          type: array
          items:
            $ref: '#/components/schemas/ApiToken'
        pool_statistics:
          $ref: '#/components/schemas/ApiPoolStatistics'
        pool:
          oneOf:
            - $ref: '#/components/schemas/ApiYieldBriefPool_Dex'
          discriminator:
            propertyName: 'yieldTypeResolver'
            mapping:
              dex_pool: '#/components/schemas/ApiYieldBriefPool_Dex'
    ApiYieldSearchResponse:
      type: object
      required:
        - pools
        - total_count
      properties:
        total_count:
          type: integer
          format: int32
        pools:
          type: array
          items:
            $ref: '#/components/schemas/ApiYieldPool'
    ApiYieldDetails_Dex:
      type: object
      required:
        - pool
        - boosts
        - total_supply
      properties:
        pool:
          $ref: '#/components/schemas/ApiPool'
        boosts:
          type: array
          items:
            $ref: '#/components/schemas/ApiBoost'
        total_supply:
          type: string
          description: Absolute value of total minted LP for this pool
    ApiYieldDetails_DexCLMM:
      type: object
      required:
        - pool
        - boosts
      properties:
        pool:
          $ref: '#/components/schemas/ApiPoolCLMM'
        boosts:
          type: array
          items:
            $ref: '#/components/schemas/ApiBoost'
    ApiYieldDetails_DexDLMM:
      type: object
      required:
        - pool
        - boosts
      properties:
        pool:
          $ref: '#/components/schemas/ApiPoolDLMM'
        boosts:
          type: array
          items:
            $ref: '#/components/schemas/ApiBoost'
    ApiYieldDetails_LiquidStaking:
      type: object
      properties:
        pool:
          $ref: '#/components/schemas/ApiLiquidStakingPool'
        stats:
          $ref: '#/components/schemas/ApiLiquidStakingPoolStats'
      required:
        - pool
        - stats
    ApiYieldDetails_Lending:
      type: object
      properties:
        pool:
          $ref: '#/components/schemas/ApiLendingPool'
        stats:
          $ref: '#/components/schemas/ApiLendingPoolStats'
      required:
        - pool
        - stats
    ApiYieldDetails_Perpetual:
      type: object
      properties:
        pool:
          $ref: '#/components/schemas/ApiPerpetualVaultPool'
      required:
        - pool
    ApiYieldDetails_FarmixLending:
      type: object
      properties:
        pool:
          $ref: '#/components/schemas/ApiDefiLendingPool'
      required:
        - pool
    ApiYieldDetails_DaoLamaLending:
      type: object
      properties:
        pool:
          $ref: '#/components/schemas/ApiDefiLendingPool'
      required:
        - pool
    ApiYieldTokenLp:
      type: object
      required:
        - lp_address
        - provider
        - tvl_usd
      properties:
        lp_address:
          type: string
          description: LP jetton master address (equals the pool address on TON dexes)
        provider:
          $ref: '#/components/schemas/ApiSupportedYields'
        tvl_usd:
          type: number
          format: double
          description: TVL of the pool in USD
    ApiYieldTokenTvl:
      type: object
      required:
        - total_tvl_usd
        - pools_count
      properties:
        total_tvl_usd:
          type: number
          format: double
          description: Sum of TVL of all yield pools which contain the token
        pools_count:
          type: integer
          description: Number of yield pools which contain the token
    ApiYieldDetails:
      type: object
      required:
        - pool_statistics
        - pool
      properties:
        pool_statistics:
          $ref: '#/components/schemas/ApiPoolStatistics'
        pool:
          oneOf:
            - $ref: '#/components/schemas/ApiYieldDetails_Dex'
            - $ref: '#/components/schemas/ApiYieldDetails_DexCLMM'
            - $ref: '#/components/schemas/ApiYieldDetails_DexDLMM'
            - $ref: '#/components/schemas/ApiYieldDetails_LiquidStaking'
            - $ref: '#/components/schemas/ApiYieldDetails_Lending'
            - $ref: '#/components/schemas/ApiYieldDetails_Perpetual'
            - $ref: '#/components/schemas/ApiYieldDetails_FarmixLending'
            - $ref: '#/components/schemas/ApiYieldDetails_DaoLamaLending'
          discriminator:
            propertyName: 'yieldTypeResolver'
            mapping:
              dex_pool: '#/components/schemas/ApiYieldDetails_Dex'
              dex_pool_clmm: '#/components/schemas/ApiYieldDetails_DexCLMM'
              dex_pool_dlmm: '#/components/schemas/ApiYieldDetails_DexDLMM'
              liquid_staking_pool: '#/components/schemas/ApiYieldDetails_LiquidStaking'
              lending_pool: '#/components/schemas/ApiYieldDetails_Lending'
              perpetual_vault_pool: '#/components/schemas/ApiYieldDetails_Perpetual'
              farmix_lending_pool: '#/components/schemas/ApiYieldDetails_FarmixLending'
              daolama_lending_pool: '#/components/schemas/ApiYieldDetails_DaoLamaLending'
    ApiYieldUserDetails_Dex:
      type: object
      required:
        - user_lp_amount
        - user_lp_wallet
        - boosts
      properties:
        user_lp_amount:
          type: string
          description: Absolute value, user's LP amount
        user_lp_wallet:
          type: string
          description: User's jetton wallet, where LP tokens are stored
        boosts:
          description: Available boosts to claim
          type: array
          items:
            $ref: '#/components/schemas/ApiClaimingTokenStats'

    ApiDexClmmPosition:
      type: object
      required:
        - tick_lower
        - tick_upper
        - is_active
        - position_id
        - position_address
        - liquidity
        - fee_owed_0
        - fee_owed_1
      properties:
        tick_lower:
          type: integer
          format: int64
          description: Tick index, where position starts
        tick_upper:
          type: integer
          format: int64
          description: Tick index, where position ends
        is_active:
          type: boolean
          description: Whether position is active or not
        position_id:
          type: integer
          format: int64
          description: Position id, used for interaction with CLMM protocol
        position_address:
          type: string
          description: Position address, used for interaction with CLMM protocol
        liquidity:
          type: string
          description: Position liquidity, absolute value
        fee_owed_0:
          type: string
          description: Fee available to claim in token 0
        fee_owed_1:
          type: string
          description: Fee available to claim in token 1
    ApiDexDlmmPosition:
      type: object
      required:
        - bin
        - is_active
        - position_address
        - liquidity
        - amount_x
        - amount_y
        - price_lower
        - price_upper
      properties:
        bin:
          type: integer
          format: int32
          description: Bin index
        is_active:
          type: boolean
          description: Whether the position is active
        position_address:
          type: string
          description: Position address
        liquidity:
          type: string
          description: Raw liquidity amount
        amount_x:
          type: number
          format: double
          description: Amount of token X
        amount_y:
          type: number
          format: double
          description: Amount of token X
        price_lower:
          type: number
          format: double
          description: Lower bound of the price
        price_upper:
          type: number
          format: double
          description: Upper bound of the price
    ApiYieldUserDetails_DexCLMM:
      type: object
      required:
        - positions
        - boosts
      properties:
        positions:
          type: array
          items:
            $ref: '#/components/schemas/ApiDexClmmPosition'
        boosts:
          description: Available boosts to claim
          type: array
          items:
            $ref: '#/components/schemas/ApiClaimingTokenStats'
    ApiYieldUserDetails_DexDLMM:
      type: object
      required:
        - positions
        - boosts
      properties:
        positions:
          type: array
          items:
            $ref: '#/components/schemas/ApiDexDlmmPosition'
        boosts:
          description: Available boosts to claim
          type: array
          items:
            $ref: '#/components/schemas/ApiClaimingTokenStats'

    ApiYieldUserDetails_LiquidStaking:
      type: object
      required:
        - base_token_amount
        - liquid_token_amount
      properties:
        base_token_amount:
          type: string
        liquid_token_amount:
          type: string
    ApiYieldUserDetails_Lending:
      type: object
      required:
        - amount
      properties:
        amount:
          type: string
          format: bigint
          description: Amount of token. Positive value denotes supplied token. Negative value denotes borrowed token.
    ApiYieldUserDetails_Perpetual:
      type: object
      required:
        - lp_amount
        - quote_amount
      properties:
        lp_amount:
          type: string
          format: bigint
          description: Amount of lp token, which can be burned to get quote token.
        quote_amount:
          type: string
          format: bigint
          description: Amount of quote tokens which can be deposited into vault.
    ApiYieldUserDetails_FarmixLending:
      type: object
      required:
        - lp_amount
      properties:
        lp_amount:
          type: string
          format: bigint
          description: Amount of lp token, which can be burned to get underlying  token.
    ApiYieldUserDetails:
      type: object
      required:
        - pool
      properties:
        pool:
          oneOf:
            - $ref: '#/components/schemas/ApiYieldUserDetails_Dex'
            - $ref: '#/components/schemas/ApiYieldUserDetails_DexCLMM'
            - $ref: '#/components/schemas/ApiYieldUserDetails_DexDLMM'
            - $ref: '#/components/schemas/ApiYieldUserDetails_LiquidStaking'
            - $ref: '#/components/schemas/ApiYieldUserDetails_Lending'
            - $ref: '#/components/schemas/ApiYieldUserDetails_Perpetual'
            - $ref: '#/components/schemas/ApiYieldUserDetails_FarmixLending'
          discriminator:
            propertyName: 'yieldTypeResolver'
            mapping:
              dex_pool: '#/components/schemas/ApiYieldUserDetails_Dex'
              dex_pool_clmm: '#/components/schemas/ApiYieldUserDetails_DexCLMM'
              dex_pool_dlmm: '#/components/schemas/ApiYieldUserDetails_DexDLMM'
              liquid_staking: '#/components/schemas/ApiYieldUserDetails_LiquidStaking'
              lending: '#/components/schemas/ApiYieldUserDetails_Lending'
              perpetual_vault_pool: '#/components/schemas/ApiYieldUserDetails_Perpetual'
              farmix_lending_pool: '#/components/schemas/ApiYieldUserDetails_FarmixLending'
    ApiYieldInteractionRequest_DexStonfiWithdrawFromStaking:
      type: object
      required:
        - position_address
      properties:
        position_address:
          type: string
          description: Stonfi farm position address
          example: EQDY6PMeMbQSz7dltNN4RRTIxyuBJX4dQESOy8cWR2tUgBxH
    ApiYieldInteractionRequest_LiquidStakingStake:
      type: object
      required:
        - amount
      properties:
        amount:
          type: string
    ApiYieldInteractionRequest_LiquidStakingUnstake:
      type: object
      required:
        - amount
      properties:
        amount:
          type: string
    ApiYieldInteractionRequest_LendingDeposit:
      type: object
      required:
        - amount
      properties:
        amount:
          type: string
          format: bigint
          description: Input amount
    ApiYieldInteractionRequest_LendingWithdraw:
      type: object
      required:
        - amount
      properties:
        amount:
          type: string
          format: bigint
          description: Input amount
    ApiYieldInteractionRequest:
      type: object
      required:
        - request_data
      properties:
        request_data:
          oneOf:
            - $ref: '#/components/schemas/ApiDexPoolLiquidityProvisioningRequest'
            - $ref: '#/components/schemas/ApiDexCLMMPoolLiquidityProvisioningRequest'
            - $ref: '#/components/schemas/ApiDexDLMMPoolLiquidityProvisioningRequest'
            - $ref: '#/components/schemas/ApiDexPoolLiquidityWithdrawalRequest'
            - $ref: '#/components/schemas/ApiDexCLMMPoolLiquidityWithdrawalRequest'
            - $ref: '#/components/schemas/ApiDexDLMMLiquidityWithdrawalRequest'
            - $ref: '#/components/schemas/ApiStonfiFarmRequest'
            - $ref: '#/components/schemas/ApiYieldInteractionRequest_DexStonfiWithdrawFromStaking'
            - $ref: '#/components/schemas/ApiYieldInteractionRequest_LiquidStakingStake'
            - $ref: '#/components/schemas/ApiYieldInteractionRequest_LiquidStakingUnstake'
            - $ref: "#/components/schemas/ApiYieldInteractionRequest_LendingDeposit"
            - $ref: "#/components/schemas/ApiYieldInteractionRequest_LendingWithdraw"
          discriminator:
            propertyName: 'yieldTypeResolver'
            mapping:
              dex_provide_liquidity: '#/components/schemas/ApiDexPoolLiquidityProvisioningRequest'
              dex_withdraw_liquidity: '#/components/schemas/ApiDexPoolLiquidityWithdrawalRequest'
              dex_clmm_provide_liquidity: '#/components/schemas/ApiDexCLMMPoolLiquidityProvisioningRequest'
              dex_clmm_withdraw_liquidity: '#/components/schemas/ApiDexCLMMPoolLiquidityWithdrawalRequest'
              dex_dlmm_provide_liquidity: '#/components/schemas/ApiDexDLMMPoolLiquidityProvisioningRequest'
              dex_dlmm_withdraw_liquidity: '#/components/schemas/ApiDexDLMMLiquidityWithdrawalRequest'
              dex_stonfi_lock_staking: '#/components/schemas/ApiStonfiFarmRequest'
              dex_stonfi_withdraw_staking: '#/components/schemas/ApiYieldInteractionRequest_DexStonfiWithdrawFromStaking'
              liquid_staking_stake: '#/components/schemas/ApiYieldInteractionRequest_LiquidStakingStake'
              liquid_staking_unstake: '#/components/schemas/ApiYieldInteractionRequest_LiquidStakingUnstake'
              lending_deposit: "#/components/schemas/ApiYieldInteractionRequest_LendingDeposit"
              lending_withdraw: "#/components/schemas/ApiYieldInteractionRequest_LendingWithdraw"
    ApiPartnershipClaimingAccrualEntry:
      type: object
      required:
        - wallet
        - amount
      properties:
        wallet:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        amount:
          type: string
          format: int128
          example: "1000000000"
    ApiPartnershipClaimingAccrualRequest:
      type: object
      required:
        - token
        - entries
      properties:
        token:
          type: string
          example: EQCl0S4xvoeGeFGijTzicSA8j6GiiugmJW5zxQbZTUntre-1
        entries:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/ApiPartnershipClaimingAccrualEntry'
    ApiPartnershipClaimingGlobalData:
      type: object
      required:
        - accrued
        - total
      properties:
        accrued:
          type: string
          format: int128
          example: "1000000000"
        total:
          type: string
          format: int128
          example: "1000000000"
    ApiPartnershipClaimingUserData:
      type: object
      required:
        - wallet
        - claimed
        - total
      properties:
        wallet:
          type: string
          example: UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV
        claimed:
          type: string
          format: int128
          example: "1000000000"
        total:
          type: string
          format: int128
          example: "1000000000"
