Skip to content

Commit

Permalink
Fix Muesli pools
Browse files Browse the repository at this point in the history
  • Loading branch information
Sluder committed Nov 30, 2023
1 parent ab36ce5 commit 220473a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/providers/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ kupo \
--match "026a18d04a0c642759bb3d83b12e3344894e5c1c7b2aeb1a2113a570.4c" \
--match "13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f.4d494e53574150" \
--match "addr1w9qzpelu9hn45pefc0xr4ac4kdxeswq7pndul2vuj59u8tqaxdznu"
--match "ffcdbb9155da0602280c04d8b36efde35e3416567f9241aff0955269.4d7565736c69537761705f414d4d" \
--match "{ Your Address }"
```
7 changes: 4 additions & 3 deletions src/dex/muesliswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export class MuesliSwap extends BaseDex {
*/
public readonly orderAddress: string = 'addr1zyq0kyrml023kwjk8zr86d5gaxrt5w8lxnah8r6m6s4jp4g3r6dxnzml343sx8jweqn4vn3fz2kj8kgu9czghx0jrsyqqktyhv';
public readonly lpTokenPolicyId: string = 'af3d70acf4bd5b3abb319a7d75c89fb3e56eafcdd46b2e9b57a2557f';
public readonly poolNftPolicyId: string = '909133088303c49f3a30f1cc8ed553a73857a29779f6c6561cd8093f';
public readonly poolNftPolicyIdV1: string = '909133088303c49f3a30f1cc8ed553a73857a29779f6c6561cd8093f';
public readonly poolNftPolicyIdV2: string = '7a8041a0693e6605d010d5185b034d55c79eaf7ef878aae3bdcdbf67';
public readonly factoryToken: string = 'de9b756719341e79785aa13c164e7fe68c189ed04d61c9876b2fe53f4d7565736c69537761705f414d4d';

constructor(requestConfig: RequestConfig = {}) {
Expand Down Expand Up @@ -79,7 +80,7 @@ export class MuesliSwap extends BaseDex {
const assetBalanceId: string = assetBalance.asset === 'lovelace' ? 'lovelace' : assetBalance.asset.identifier();

return ! assetBalanceId.startsWith(this.factoryToken.slice(0, 56))
&& ! assetBalanceId.startsWith(this.poolNftPolicyId);
&& ! [this.poolNftPolicyIdV1, this.poolNftPolicyIdV2].includes(assetBalanceId);
});

// Irrelevant UTxO
Expand All @@ -104,7 +105,7 @@ export class MuesliSwap extends BaseDex {

// Load additional pool information
const lpToken: Asset = utxo.assetBalances.find((assetBalance: AssetBalance) => {
return assetBalance.asset !== 'lovelace' && assetBalance.asset.policyId === this.poolNftPolicyId;
return assetBalance.asset !== 'lovelace' && [this.poolNftPolicyIdV1, this.poolNftPolicyIdV2].includes(assetBalance.asset.policyId);
})?.asset as Asset;

if (lpToken) {
Expand Down

0 comments on commit 220473a

Please sign in to comment.