Mc/tcs p95 (#708)

* use more fine grain price impact

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* ts: for computing tcs premium use more fine grain price impact

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2023-09-23 15:56:55 +02:00 committed by GitHub
parent f3431917b8
commit 5ee00a6639
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -50,6 +50,8 @@ export type PriceImpact = {
avg_price_impact_percent: number;
min_price_impact_percent: number;
max_price_impact_percent: number;
p90: number;
p95: number;
};
/**
@ -73,7 +75,7 @@ export function computePriceImpactOnJup(
(pi) => pi.symbol == tokenName && pi.target_amount == closestTo,
);
if (filteredPis.length > 0) {
return (filteredPis[0].avg_price_impact_percent * 10000) / 100;
return (filteredPis[0].p90 * 10000) / 100;
} else {
return -1;
}