Skip to content

Commit c238b09

Browse files
Merge pull request #1511 from xchainjs/hippo/expose-liquidity-fee-thorchain-query
Exponse liquidity fee on thorchain query
2 parents 8de88d2 + 74eba1f commit c238b09

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.changeset/seven-birds-walk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@xchainjs/xchain-thorchain-query': patch
3+
---
4+
5+
Expose liquidity fee

packages/xchain-thorchain-query/src/thorchain-query.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export class ThorchainQuery {
173173
asset: destinationAsset,
174174
affiliateFee: new AssetCryptoAmount(baseAmount(0), AssetRuneNative),
175175
outboundFee: new AssetCryptoAmount(baseAmount(0), AssetRuneNative),
176+
liquidityFee: new AssetCryptoAmount(baseAmount(0), AssetRuneNative),
176177
},
177178
slipBasisPoints: 0,
178179
netOutput: new CryptoAmount(baseAmount(0), destinationAsset),
@@ -225,6 +226,10 @@ export class ThorchainQuery {
225226
new CryptoAmount(baseAmount(swapQuote.fees.outbound), feeAsset),
226227
feeAssetDecimals,
227228
),
229+
liquidityFee: getCryptoAmountWithNotation(
230+
new CryptoAmount(baseAmount(swapQuote.fees.liquidity), feeAsset),
231+
feeAssetDecimals,
232+
),
228233
},
229234
slipBasisPoints: swapQuote.fees.slippage_bps,
230235
netOutput: getCryptoAmountWithNotation(
@@ -330,6 +335,7 @@ export class ThorchainQuery {
330335
// swapFee: await this.convert(fees.swapFee, asset),
331336
outboundFee: await this.convert(fees.outboundFee, asset),
332337
affiliateFee: await this.convert(fees.affiliateFee, asset),
338+
liquidityFee: await this.convert(fees.liquidityFee, asset),
333339
// totatBps: fees.totatBps,
334340
}
335341
}

packages/xchain-thorchain-query/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type TotalFees = {
2424
asset: CompatibleAsset // The asset for which fees are calculated
2525
affiliateFee: CryptoAmount<CompatibleAsset> // The affiliate fee
2626
outboundFee: CryptoAmount<CompatibleAsset> // The outbound fee
27+
liquidityFee: CryptoAmount<CompatibleAsset> // The liquidity fee
2728
}
2829
/**
2930
* Represents an estimate for a swap transaction.

0 commit comments

Comments
 (0)