Function getPriceNeighborhood

  • Calculates and returns the neighboring price ticks and their corresponding prices for a given input price.

    Parameters

    Returns {
        normal: {
            nextUp: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
            up: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
            now: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
            down: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
            nextDown: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
        };
        inverted: {
            nextUp: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
            up: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
            now: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
            down: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
            nextDown: {
                tick: bigint;
                price: string;
                marketPrice: string;
            };
        };
    }

    An object containing the normal and inverted price neighborhoods. Each neighborhood includes:

    • up: The tick and price for one tick above the current price.
    • now: The tick and price for the current price.
    • down: The tick and price for one tick below the current price.
    • normal: {
          nextUp: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
          up: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
          now: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
          down: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
          nextDown: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
      }
      • nextUp: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string
      • up: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string
      • now: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string
      • down: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string
      • nextDown: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string
    • inverted: {
          nextUp: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
          up: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
          now: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
          down: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
          nextDown: {
              tick: bigint;
              price: string;
              marketPrice: string;
          };
      }
      • nextUp: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string
      • up: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string
      • now: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string
      • down: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string
      • nextDown: {
            tick: bigint;
            price: string;
            marketPrice: string;
        }
        • tick: bigint
        • price: string
        • marketPrice: string