@steerprotocol/sdk 1.30.0 → 1.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -488,7 +488,11 @@ class VaultClient extends SubgraphClient_js_1.SubgraphClient {
488
488
  // Prefer API APR data, but use subgraph if API doesn't have it
489
489
  feeApr: existing.node.feeApr ?? edge.node.feeApr,
490
490
  stakingApr: existing.node.stakingApr ?? edge.node.stakingApr,
491
- merklApr: existing.node.merklApr ?? edge.node.merklApr
491
+ merklApr: existing.node.merklApr ?? edge.node.merklApr,
492
+ // Subgraph-only fields: always take from subgraph when available
493
+ positions: existing.node.positions ?? edge.node.positions,
494
+ tickRange: existing.node.tickRange ?? edge.node.tickRange,
495
+ fees: existing.node.fees ?? edge.node.fees,
492
496
  }
493
497
  };
494
498
  vaultMap.set(key, merged);
@@ -581,46 +585,71 @@ class VaultClient extends SubgraphClient_js_1.SubgraphClient {
581
585
  }
582
586
  });
583
587
  // Transform to VaultEdge array with APR data
584
- const vaultEdges = subgraphVaults.map((vault, index) => ({
585
- cursor: `subgraph_${chainId}_${index}`,
586
- node: {
587
- id: vault.id,
588
- chainId: chainId,
589
- vaultAddress: vault.id,
590
- protocol: vault.beaconName || '',
591
- beaconName: vault.beaconName || '',
592
- protocolBaseType: vault.beaconName || '',
593
- name: `${vault.token0Symbol}/${vault.token1Symbol}`,
594
- feeApr: aprMap.get(vault.id.toLowerCase()),
595
- stakingApr: undefined,
596
- merklApr: undefined,
597
- pool: {
598
- id: vault.pool || '',
599
- poolAddress: vault.pool || '',
600
- feeTier: vault.feeTier || '',
601
- tick: undefined,
602
- liquidity: undefined,
603
- volumeUSD: undefined,
604
- totalValueLockedUSD: undefined
605
- },
606
- token0: {
607
- id: vault.token0,
608
- symbol: vault.token0Symbol,
609
- name: vault.token0Symbol, // Use symbol as name since subgraph doesn't provide name
610
- decimals: parseInt(vault.token0Decimals) || 18,
611
- address: vault.token0,
612
- chainId: chainId
613
- },
614
- token1: {
615
- id: vault.token1,
616
- symbol: vault.token1Symbol,
617
- name: vault.token1Symbol, // Use symbol as name since subgraph doesn't provide name
618
- decimals: parseInt(vault.token1Decimals) || 18,
619
- address: vault.token1,
620
- chainId: chainId
621
- }
588
+ const vaultEdges = subgraphVaults.map((vault, index) => {
589
+ // Parse positions and compute tick range
590
+ const positions = vault.positions?.map(pos => ({
591
+ id: pos.id,
592
+ upperTick: parseInt(pos.upperTick),
593
+ lowerTick: parseInt(pos.lowerTick),
594
+ relativeWeight: pos.relativeWeight
595
+ }));
596
+ // Compute tick range from positions
597
+ let tickRange;
598
+ if (positions && positions.length > 0) {
599
+ const lowerTicks = positions.map(p => p.lowerTick);
600
+ const upperTicks = positions.map(p => p.upperTick);
601
+ tickRange = {
602
+ minLowerTick: Math.min(...lowerTicks),
603
+ maxUpperTick: Math.max(...upperTicks)
604
+ };
622
605
  }
623
- }));
606
+ return {
607
+ cursor: `subgraph_${chainId}_${index}`,
608
+ node: {
609
+ id: vault.id,
610
+ chainId: chainId,
611
+ vaultAddress: vault.id,
612
+ protocol: vault.beaconName || '',
613
+ beaconName: vault.beaconName || '',
614
+ protocolBaseType: vault.beaconName || '',
615
+ name: `${vault.token0Symbol}/${vault.token1Symbol}`,
616
+ feeApr: aprMap.get(vault.id.toLowerCase()),
617
+ stakingApr: undefined,
618
+ merklApr: undefined,
619
+ positions,
620
+ tickRange,
621
+ fees: vault.fees0 && vault.fees1 ? {
622
+ fees0: vault.fees0,
623
+ fees1: vault.fees1
624
+ } : undefined,
625
+ pool: {
626
+ id: vault.pool || '',
627
+ poolAddress: vault.pool || '',
628
+ feeTier: vault.feeTier || '',
629
+ tick: undefined,
630
+ liquidity: undefined,
631
+ volumeUSD: undefined,
632
+ totalValueLockedUSD: undefined
633
+ },
634
+ token0: {
635
+ id: vault.token0,
636
+ symbol: vault.token0Symbol,
637
+ name: vault.token0Symbol, // Use symbol as name since subgraph doesn't provide name
638
+ decimals: parseInt(vault.token0Decimals) || 18,
639
+ address: vault.token0,
640
+ chainId: chainId
641
+ },
642
+ token1: {
643
+ id: vault.token1,
644
+ symbol: vault.token1Symbol,
645
+ name: vault.token1Symbol, // Use symbol as name since subgraph doesn't provide name
646
+ decimals: parseInt(vault.token1Decimals) || 18,
647
+ address: vault.token1,
648
+ chainId: chainId
649
+ }
650
+ }
651
+ };
652
+ });
624
653
  return {
625
654
  data: vaultEdges,
626
655
  status: 200,