# /updateTrigger

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /updateTrigger:
    post:
      summary: /updateTrigger
      deprecated: false
      description: ''
      tags: []
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                payloadSignature:
                  type: string
                  minLength: 1
                  description: Signature of the payload.
                payload:
                  type: object
                  properties:
                    ownerAddr:
                      type: string
                      minLength: 1
                      description: >-
                        The owner address of the position; must be a checksum
                        address.
                    chainId:
                      type: number
                      enum:
                        - 1
                        - 42161
                        - 5
                        - 421613
                      description: >-
                        The chain id of the network. Must be one of the chains
                        supported by Aperture.
                      examples:
                        - 1
                    taskId:
                      type: number
                      minimum: 0
                      description: >-
                        The task id of the trigger in Aperture's automation
                        service.
                    action:
                      discriminator:
                        propertyName: type
                      oneOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - Close
                            slippage:
                              type: number
                              minimum: 0
                              maximum: 1
                              description: >-
                                A number between 0 and 1, inclusive, which
                                Aperture will use as the slippage setting when
                                triggering the action after condition is met.
                                Digits after the sixth decimal point are
                                ignored, i.e. the precision is 0.000001.
                            maxGasProportion:
                              type: number
                              minimum: 0
                              exclusiveMinimum: true
                              maximum: 0.5
                              description: >-
                                Aperture deducts tokens from the position to
                                cover the cost of performing this action (gas).
                                The `maxGasProportion` value represents the
                                largest allowed proportion of the position value
                                to be deducted. For example, a
                                `maxGasProportion` of 0.10 represents 10% of the
                                position, i.e. no more than 10% of the
                                position's tokens (principal and accrued fees)
                                may be deducted. If network gas price is high
                                and the deduction would exceed the specified
                                ceiling, then the action will not be triggered.
                          required:
                            - type
                            - slippage
                            - maxGasProportion
                          description: >-
                            The "Close" action close the position, and send both
                            tokens (principal and collected fees) to the
                            position owner.
                          x-apidog-orders:
                            - type
                            - slippage
                            - maxGasProportion
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - LimitOrderClose
                            inputTokenAddr:
                              type: string
                              minLength: 1
                              description: >-
                                The address of the input token for the limit
                                order, i.e. the token which the user provided
                                and wants to sell. Must be one of the two tokens
                                in the position.
                            maxGasProportion:
                              type: number
                              minimum: 0
                              exclusiveMinimum: true
                              maximum: 0.5
                              description: >-
                                Aperture deducts tokens from the position to
                                cover the cost of performing this action (gas).
                                The `maxGasProportion` value represents the
                                largest allowed proportion of the position value
                                to be deducted. For example, a
                                `maxGasProportion` of 0.10 represents 10% of the
                                position, i.e. no more than 10% of the
                                position's tokens (principal and accrued fees)
                                may be deducted. If network gas price is high
                                and the deduction would exceed the specified
                                ceiling, then the action will not be triggered.
                          required:
                            - type
                            - inputTokenAddr
                            - maxGasProportion
                          description: >-
                            The 'LimitOrderClose' action behaves the same as
                            'Close' but the position serves a limit order placed
                            through Aperture. No slippage needs to be specified
                            as limit order positions are always closed with a
                            zero slippage setting.
                          x-apidog-orders:
                            - type
                            - inputTokenAddr
                            - maxGasProportion
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - Reinvest
                            slippage:
                              type: number
                              minimum: 0
                              maximum: 1
                              description: >-
                                A number between 0 and 1, inclusive, which
                                Aperture will use as the slippage setting when
                                triggering the action after condition is met.
                                Digits after the sixth decimal point are
                                ignored, i.e. the precision is 0.000001.
                            maxGasProportion:
                              type: number
                              minimum: 0
                              exclusiveMinimum: true
                              maximum: 0.5
                              description: >-
                                Aperture deducts tokens from the position to
                                cover the cost of performing this action (gas).
                                The `maxGasProportion` value represents the
                                largest allowed proportion of the position value
                                to be deducted. For example, a
                                `maxGasProportion` of 0.10 represents 10% of the
                                position, i.e. no more than 10% of the
                                position's tokens (principal and accrued fees)
                                may be deducted. If network gas price is high
                                and the deduction would exceed the specified
                                ceiling, then the action will not be triggered.
                          required:
                            - type
                            - slippage
                            - maxGasProportion
                          description: >-
                            The "Reinvest" action claims accrued fees, swap them
                            to the same ratio as the principal amounts, and add
                            liquidity.
                          x-apidog-orders:
                            - type
                            - slippage
                            - maxGasProportion
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - Rebalance
                            tickLower:
                              type: integer
                              description: The lower tick of the new price range.
                            tickUpper:
                              type: integer
                              description: The upper tick of the new price range.
                            slippage:
                              type: number
                              minimum: 0
                              maximum: 1
                              description: >-
                                A number between 0 and 1, inclusive, which
                                Aperture will use as the slippage setting when
                                triggering the action after condition is met.
                                Digits after the sixth decimal point are
                                ignored, i.e. the precision is 0.000001.
                            maxGasProportion:
                              type: number
                              minimum: 0
                              exclusiveMinimum: true
                              maximum: 0.5
                              description: >-
                                Aperture deducts tokens from the position to
                                cover the cost of performing this action (gas).
                                The `maxGasProportion` value represents the
                                largest allowed proportion of the position value
                                to be deducted. For example, a
                                `maxGasProportion` of 0.10 represents 10% of the
                                position, i.e. no more than 10% of the
                                position's tokens (principal and accrued fees)
                                may be deducted. If network gas price is high
                                and the deduction would exceed the specified
                                ceiling, then the action will not be triggered.
                          required:
                            - type
                            - tickLower
                            - tickUpper
                            - slippage
                            - maxGasProportion
                          description: >-
                            The "Rebalance" action closes the position, and swap
                            tokens (principal and collected fees) to the ratio
                            required by the specified new price range, and open
                            a position with that price range.
                          x-apidog-orders:
                            - type
                            - tickLower
                            - tickUpper
                            - slippage
                            - maxGasProportion
                      description: >-
                        If populated, update the action to details specified
                        here; otherwise, action details remain unchanged.
                    condition:
                      discriminator:
                        propertyName: type
                      oneOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - Time
                            timeAfterEpochSec:
                              type: integer
                              minimum: 0
                              exclusiveMinimum: true
                              description: >-
                                This timestamp threshold is specified as the
                                number of seconds since UNIX epoch.
                          required:
                            - type
                            - timeAfterEpochSec
                          description: >-
                            The "Time" condition is considered met if the
                            current time meets or exceeds the threshold
                            specified by `timeAfterEpochSec`.
                          x-apidog-orders:
                            - type
                            - timeAfterEpochSec
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - TokenAmount
                            zeroAmountToken:
                              type: number
                              enum:
                                - 0
                                - 1
                              description: >-
                                Either 0 or 1, representing token0 or token1,
                                respectively.
                          required:
                            - type
                            - zeroAmountToken
                          description: >-
                            The "TokenAmount" condition is considered met if the
                            specified token has a zero (principal) amount in the
                            position. `zeroAmountToken` can only be either 0 or
                            1, representing token0 or token1 in the position,
                            respectively. For example, if `zeroAmountToken` is
                            1, then the condition is considered met if token1 in
                            the position is exactly zero. Note that only the
                            principal amount is considered; accrued fees are
                            not.
                          x-apidog-orders:
                            - type
                            - zeroAmountToken
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - Price
                            singleToken:
                              type: number
                              enum:
                                - 0
                                - 1
                              description: >-
                                If `singleToken` is set, the condition is
                                considered met if the current USD price of the
                                specified token (either token0 or token1) meets
                                the specified threshold; otherwise, token0's
                                price denominated in token1 is compared against
                                the specified threshold,
                            gte:
                              type: string
                              description: >-
                                If `gte` is set, the condition is considered met
                                if the current price >= `gte`.
                            lte:
                              type: string
                              description: >-
                                If `lte` is set, the condition is considered met
                                if the current price <= `lte`.
                            durationSec:
                              type: integer
                              minimum: 0
                              exclusiveMinimum: true
                              description: >-
                                If set, the condition is only considered met if
                                the price remains satisfaction the threshold
                                requirement for at least the past `durationSec`
                                seconds. For example, if `gte` is 10 and
                                `durationSec` is set to 3600, then the condition
                                is only considered met if the price remains >=
                                10 for the entire past hour. The historical
                                price feed used is Coingecko.
                          required:
                            - type
                          description: >-
                            The 'Price' condition checks either one token's
                            price or the two tokens' relative price. If
                            `singleToken` is set, the price condition compares
                            the specified token's USD price against the
                            specified threshold.Otherwise, token0's price
                            denominated in token1 is compared against the
                            specified threshold, and we follow how a Uniswap V3
                            liquidity pool defines price, i.e. how much raw
                            token1 equals 1 raw token0 in value. "Raw" means the
                            raw uint256 integer amount used in the token
                            contract. For example, if token A uses 8 decimals,
                            then 1 raw token A represents 10^(-8) tokens in
                            human-readable form.
                          x-apidog-orders:
                            - type
                            - singleToken
                            - gte
                            - lte
                            - durationSec
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - AccruedFees
                            feeToPrincipalRatioThreshold:
                              type: number
                              minimum: 0
                              exclusiveMinimum: true
                              description: >-
                                The threshold ratio between the accrued fee
                                value and the principal value in the position.
                          required:
                            - type
                            - feeToPrincipalRatioThreshold
                          description: >-
                            The accrued-fees condition specifies a threshold in
                            the form of the ratio between the value of accrued
                            fees and that of principal tokens in a specific
                            liquidity position. This condition serves
                            "auto-compound" which triggers a "reinvest" action
                            whenever the accrued fees meet the threshold
                            specified in this condition.
                          x-apidog-orders:
                            - type
                            - feeToPrincipalRatioThreshold
                      description: >-
                        If populated, update the condition to details specified
                        here; otherwise, condition details remain unchanged.
                    expiration:
                      type: integer
                      minimum: 0
                      exclusiveMinimum: true
                      description: Unix timestamp in seconds when this trigger expires.
                  required:
                    - ownerAddr
                    - chainId
                    - taskId
                    - expiration
                  x-apidog-orders:
                    - ownerAddr
                    - chainId
                    - taskId
                    - action
                    - condition
                    - expiration
              required:
                - payloadSignature
                - payload
              x-apidog-orders:
                - payloadSignature
                - payload
            example: ''
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
          headers: {}
          x-apidog-name: The trigger has been successfully updated.
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: string
                description: Message explaining why the request is bad
          headers: {}
          x-apidog-name: Bad Request
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: string
                description: Message explaining the error encountered
          headers: {}
          x-apidog-name: Internal Server Error
      security: []
      x-apidog-folder: ''
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/368746/apis/api-3853888-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.aperture.finance
    description: Prod Env
  - url: https://api.hyperfocal.tech
    description: Testing Env
security: []

```
