Skip to content

Commit

Permalink
add dao fee to pool display #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Feb 23, 2024
1 parent ce25de3 commit 6aa9f29
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/common/models/AmmPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export abstract class AmmPool {

abstract get feeNum(): bigint;

abstract get treasuryFeeNum(): bigint | undefined;

abstract get feeDenom(): bigint;

abstract get feeDecimalsCount(): bigint;
Expand Down Expand Up @@ -71,6 +73,17 @@ export abstract class AmmPool {
).toFixed(1);
}

get treasuryFee(): number | undefined {
if (!this.treasuryFeeNum) {
return undefined;
}
return evaluate(
`${this.treasuryFeeNum} / (${
this.feeDenom / 10n ** this.feeDecimalsCount
})`,
);
}

get xRatio(): Ratio {
return this.getRatio(this.x, this.y);
}
Expand Down

0 comments on commit 6aa9f29

Please sign in to comment.