---
# System prepended metadata

title: (Latest) Position Discussion

---

# Position Discussion

## Contract Endpoint

### StakeToken(lpTokenId)

> [Request]
> - lpTokenId: string

### UnstakeToken(lpTokenId)

> [Request]
> - lpTokenId: string

### CreateExternalIncentive(poolPath, rewardTokenPath, rewardAmount, startTime, endTime)

> [Request]
> - poolPath: string
> - rewardTokenPath: string
> - rewardAmount: bigint
> - startTime: int(UTC)
> - endTime: int(UTC)

### EndExternalIncentive(creator, poolPath, rewardTokenPath)

> [Request]
> - creator: string
> - poolPath: string
> - rewardTokenPath: string

### Collect(lpTokenId, receipient, amount0Max, amount1Max)

> [Request]
> - lpTokenId: string
> - receipient: string

### CollectReward()

### DecreaseLiquidity(lpTokenId, liquidity, amount0Min, amount1Min, deadline)

> [Request]
> - lpTokenId: string
> - liquidity: bigint
> - amount0Min: bigint
> - amount1Min: bigint
> - deadline: string

> CollectPosition, CollectReward 호출 전 DecreaseLiquidity 호출해야함 (liquidity 0으로)
> owned 토큰을 unclaimed 상태로 변경

## API 추가내용

### Token 데이터

> id 추가 (GRC20은 token path, Native는 Symbol-GNOT)

### Pool 데이터

> incentivized true/false
> rewardTokens 추가 (토큰모델 목록) []list


```
interface PoolModel {
  id: string;

  path: string;

  incentivizedType: IncentivizedOptions;

  name: string;

  price: number;

  tokenA: TokenModel;

  tokenB: TokenModel;

  tokenABalance: number;

  tokenBBalance: number;

  tickSpacing: number;

  currentTick: number;

  bins: PoolBinModel[];

  tvl: number;

  tvlChange: number;

  volume: number;

  volumeChange: number;

  totalVolume: number;

  fee: string;

  feeVolume: number;

  feeChange: number;

  apr: number;

  rewardTokens: TokenModel[];
}
```


### Position 데이터

> rewards 추가 (swap fee,, external reward)
> - 리워드 타입 // SWAP_FEE, STAKING ~= INTERNAL, EXTERNAL
> - 리워드 토큰 // gno.land/r/gns
> - 리워드 클레임 가능 수량 // 1234
> - 리워드 지급된 전체 수량 // 845361 <- @IAImnx2RTaulwDazsDpzKw  어디 표시????
> - 24시간 리워드 수량 // 7일 내 발생한 하루 리워드 평균
> - 7일간 리워드 합 // ??
> - 7일간 리워드 APR // -
> - APR // -

> dailyRewards 추가
> - 리워드 타입 // EXTERNAL
> - 리워드 토큰 // gno.land/r/gns
> - 리워드 클레임 가능 수량 // 1234
> - 리워드 지급된 전체 수량 // 845361 <- @IAImnx2RTaulwDazsDpzKw  어디 표시????
> - 24시간 리워드 수량 // 7일 내 발생한 하루 리워드 평균
> - 7일간 리워드 합 // ??
> - 7일간 리워드 APR // -
> - APR // -


```
interface PositionModel {
  id: string;

  lpTokenId: string;

  incentivizedType: IncentivizedOptions;

  poolPath: string;

  staked: boolean;

  operator: string;

  tickLower: number;

  tickUpper: number;

  liquidity: bigint;

  token0Balance: bigint;

  token1Balance: bigint;

  positionUsdValue: string;

  unclaimedFee0Amount: bigint;

  unclaimedFee1Amount: bigint;

  unclaimedFee0Usd: string;

  unclaimedFee1Usd: string;

  tokensOwed0Amount: bigint;

  tokensOwed1Amount: bigint;

  tokensOwed0Usd: string;

  tokensOwed1Usd: string;

  ----------------------

  apr: string;

  stakedAt: String;

  stakedUsdValue: string;

  rewards: RewardModel[];

  dailyRewards: RewardModel[];
}
```

```
interface RewardModel {
  rewardType: RewardType;

  token: TokenModel;

  totalAmount: bigint;

  claimableAmount: bigint;

  accumulatedRewardOf1d: string;

  accumulatedRewardOf7d: string;

  apr: number;

  aprOf7d: number;
}

```



### STAKING 데이터
![image](https://hackmd.io/_uploads/Bk1wGLv8T.png)
이거 정리 필요