Skip to content

Commit

Permalink
BACK-1177: add-efficiency-factor-for-camelot
Browse files Browse the repository at this point in the history
  • Loading branch information
aburkut committed Aug 7, 2023
1 parent 5377855 commit 1fe5b42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dex/camelot/camelot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const DefaultCamelotPoolGasCost = 90 * 1000;
const camelotPairIface = new Interface(camelotPairABI);
const coder = new AbiCoder();

const CAMELOT_EFFICIENCY_FACTOR = 3;

const LogCallTopics = [
'0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1', // event Sync(uint112 reserve0, uint112 reserve1) // uni-V2 and most forks
'a4877b8ecb5a00ba277e4bceeeb187a669e7113649774dfbea05c259ce27f17b', // event FeePercentUpdated(uint16 token0FeePercent, uint16 token1FeePercent)
Expand Down Expand Up @@ -683,7 +685,7 @@ export class Camelot
decimals: parseInt(pool.token1.decimals),
},
],
liquidityUSD: parseFloat(pool.reserveUSD),
liquidityUSD: parseFloat(pool.reserveUSD) * CAMELOT_EFFICIENCY_FACTOR,
}));

const pools1 = _.map(data.pools1, pool => ({
Expand All @@ -696,7 +698,7 @@ export class Camelot
decimals: parseInt(pool.token0.decimals),
},
],
liquidityUSD: parseFloat(pool.reserveUSD),
liquidityUSD: parseFloat(pool.reserveUSD) * CAMELOT_EFFICIENCY_FACTOR,
}));

return _.slice(
Expand Down

0 comments on commit 1fe5b42

Please sign in to comment.