Skip to content

Commit

Permalink
docs: updated readme with short config explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
Doublo54 committed Aug 4, 2023
1 parent 97a526a commit 29c8ef9
Showing 1 changed file with 73 additions and 2 deletions.
75 changes: 73 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Humans interact with the TypeScript files & our services pull in the JSON files!
## Testing Locally

1. `yarn` (Install latest deps)
2. *Update lists as needed*
2. _Update lists as needed_
3. `yarn build && yarn legacy-build`
4. `npm link`
5. Go to frontend repo locally `npm link @ape.swap/apeswap-lists`

### Updating while linked

1. *Update lists as needed*
1. _Update lists as needed_
2. `yarn build && yarn legacy-build`
3. The changes should then be reflected on the local linked repo.

Expand All @@ -33,3 +33,74 @@ Humans interact with the TypeScript files & our services pull in the JSON files!
1. Go to frontend repo locally `npm unlink @ape.swap/apeswap-lists`
2. Still on local frontend: `yarn install` (Reinstall package)
3. `npm unlink`

# Config

### Token

This is the current interface of Token

```js
export interface Token {
symbol: string
address: Partial<Record<ChainId, string>>
active: boolean
decimals?: Partial<Record<ChainId, number | null>>
dontFetch?: boolean
lpToken?: boolean
price?: number
liquidityDex?: Partial<Record<ChainId, LiquidityDex>>
getLpUrl?: Partial<Record<ChainId, string>>
}
```

With more recently added properties `liquidityDex` and `getLpUrl`

### `LiquidityDex`

This property was added because of us introducing different non ApeLP bonds. For example QS (Algebra) and PCS.
This is a way of telling FE that the bond is a non ApeLP and the pricing of the LP should be retrieved differently.
Besides that we also have different zapping strategies so this also makes sure the right zap strategy is used.

```js
liquidityDex: {
[ChainId.BSC]: LiquidityDex.PancakeSwapV2,
[ChainId.Polygon]: LiquidityDex.Algebra,
},
```

### `getLpUrl`

For some non ApeLP bonds we don't have a working zap strategy and we should send users to an external url to get the right LPs. This is the url the users will be send to.

Only used and a must when zap version for liquidityDex is `ZapVersion.External`.
Check [dexToZapMapping.ts](./src/constants/dexToZapMapping.ts) for what strategy is used for what LiquidityDex.

```js
getLpUrl: {
[ChainId.BSC]: "https://www.{url}.com",
[ChainId.Polygon]: "https://www.{url}.com",
},
```

### Example config

```js
pcsBnbUsdt: {
symbol: 'BNB-USDT',
address: {
[ChainId.BSC]: '0x16b9a82891338f9bA80E2D6970FddA79D1eb0daE',
},
decimals: {
[ChainId.BSC]: 18,
},
active: false,
lpToken: true,
liquidityDex: {
[ChainId.BSC]: LiquidityDex.PancakeSwapV2,
},
getLpUrl: {
[ChainId.BSC]: 'https://pancakeswap.finance/v2/add/0x55d398326f99059fF775485246999027B3197955/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
},
},
```

0 comments on commit 29c8ef9

Please sign in to comment.