Developer FAQs
Is there an API?
How do I get quotes for a given asset?
export class QuoterService {
constructor(private readonly contractProxyFactory: ContractProxyFactory) {}
async getPerpAveragePrice(baseToken: string, amountType: AmountType, amount: Big) {
const quoterProxy = await this.contractProxyFactory.createQuoterProxy()
const side = amount.gt(0) ? Side.LONG : Side.SHORT
const { isBaseToQuote, isExactInput } = convertSideAndAmountType(side, amountType)
const swapResp = await quoterProxy.quote({
baseToken,
isBaseToQuote,
isExactInput,
amount: toWei(amount.abs()),
sqrtPriceLimitX96: Big(0),
})
return swapResp.exchangedPositionNotional.div(swapResp.exchangedPositionSize).abs()
}
}How do I obtain a value for liquidity?
liquidity?How is Net Return calculated?
How are base and quote calculated?
Last updated