UNPKG

fbonds-core

Version:

Banx protocol sdk

30 lines (29 loc) 1.09 kB
import { SimpleOffer } from './convertToSimpleOffer'; import { BN } from '@coral-xyz/anchor'; type CalcMaxCollateralToReceiveParams = { maxTokenToGet: BN; tokenDecimals: number; collateralsPerToken: BN; }; export declare function calcMaxCollateralToReceive({ maxTokenToGet, tokenDecimals, collateralsPerToken, }: CalcMaxCollateralToReceiveParams): BN; type CalcTokenToGetParams = { collateralToReceive: BN; tokenDecimals: number; collateralsPerToken: BN; }; export declare function calcTokenToGet({ collateralToReceive, tokenDecimals, collateralsPerToken }: CalcTokenToGetParams): BN; export declare function calcOfferLtv(params: { collateralsPerToken: BN; tokenPrice: BN; }): BN; export declare function calcCollateralsPerTokenByFromLtv(params: { ltv: BN; tokenPrice: BN; }): BN; export declare function calcMaxTokenToGetForMarket(simpleOffers: SimpleOffer[]): BN; export declare function calcMaxCollateralToReceiveForMarket(params: { simpleOffers: SimpleOffer[]; tokenDecimals: number; customCollateralsPerToken?: BN; }): BN; export {};