forked from mito-systems/sol-mem-gen
Remove quotes service injection in server
This commit is contained in:
parent
2e735c51dd
commit
b886aca067
@ -24,10 +24,10 @@ class QuotesService {
|
||||
const quoteResponse = await response.json();
|
||||
|
||||
// Handle price with Big.js, then convert to BN
|
||||
const priceFromAPI = new Big(quoteResponse['data'][USDC_MINT]['price']).toFixed(6);
|
||||
const price = new BN(new Big(priceFromAPI).times(new Big(10).pow(6)).toString());
|
||||
const priceMTMFor1USDC = new Big(quoteResponse['data'][USDC_MINT]['price']).toFixed(6);
|
||||
const priceInBaseUnits = new BN(new Big(priceMTMFor1USDC).times(new Big(10).pow(6)).toString());
|
||||
|
||||
this.cachedQuotes.push(price);
|
||||
this.cachedQuotes.push(priceInBaseUnits);
|
||||
if (this.cachedQuotes.length > 3) {
|
||||
this.cachedQuotes.shift();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user