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:
parent
f3431917b8
commit
5ee00a6639
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue