Compare commits
3 Commits
main
...
hls-test-d
Author | SHA1 | Date | |
---|---|---|---|
|
7ebd35fbfd | ||
|
4c88cfd99f | ||
|
373b147997 |
@ -7,12 +7,15 @@ import { resolveHLSStrategies } from 'utils/resolvers'
|
||||
|
||||
export default async function getHLSStakingAssets() {
|
||||
const stakingAssetDenoms = getStakingAssets().map((asset) => asset.denom)
|
||||
console.log('stakingAssetDenoms', stakingAssetDenoms)
|
||||
const assetParams = await getAssetParams()
|
||||
console.log('assetParams', assetParams)
|
||||
const HLSAssets = assetParams
|
||||
.filter((asset) => stakingAssetDenoms.includes(asset.denom))
|
||||
.filter((asset) => asset.credit_manager.hls)
|
||||
console.log('HLSAssets', HLSAssets)
|
||||
const strategies = resolveHLSStrategies('coin', HLSAssets)
|
||||
|
||||
console.log('strategies', strategies)
|
||||
const client = await getParamsQueryClient()
|
||||
const depositCaps$ = strategies.map((strategy) =>
|
||||
client.totalDeposit({ denom: strategy.denoms.deposit }),
|
||||
|
@ -20,5 +20,5 @@ export const DEFAULT_PORTFOLIO_STATS = [
|
||||
{ title: null, sub: 'Account Leverage' },
|
||||
]
|
||||
|
||||
export const ENABLE_HLS = false
|
||||
export const ENABLE_HLS = true
|
||||
export const ENABLE_PERPS = false
|
||||
|
8
src/utils/health_computer/index.d.ts
vendored
8
src/utils/health_computer/index.d.ts
vendored
@ -37,6 +37,12 @@ export function max_swap_estimate_js(
|
||||
kind: SwapKind,
|
||||
slippage: Slippage,
|
||||
): string
|
||||
/**
|
||||
* @param {HealthComputer} c
|
||||
* @param {string} denom
|
||||
* @returns {string}
|
||||
*/
|
||||
export function liquidation_price_js(c: HealthComputer, denom: string): string
|
||||
export interface HealthComputer {
|
||||
kind: AccountKind
|
||||
positions: Positions
|
||||
@ -82,9 +88,9 @@ export interface InitOutput {
|
||||
g: number,
|
||||
h: number,
|
||||
) => void
|
||||
readonly liquidation_price_js: (a: number, b: number, c: number, d: number) => void
|
||||
readonly allocate: (a: number) => number
|
||||
readonly deallocate: (a: number) => void
|
||||
readonly requires_stargate: () => void
|
||||
readonly requires_iterator: () => void
|
||||
readonly interface_version_8: () => void
|
||||
readonly __wbindgen_malloc: (a: number, b: number) => number
|
||||
|
@ -230,6 +230,30 @@ export function max_swap_estimate_js(c, from_denom, to_denom, kind, slippage) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HealthComputer} c
|
||||
* @param {string} denom
|
||||
* @returns {string}
|
||||
*/
|
||||
export function liquidation_price_js(c, denom) {
|
||||
let deferred2_0
|
||||
let deferred2_1
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16)
|
||||
const ptr0 = passStringToWasm0(denom, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc)
|
||||
const len0 = WASM_VECTOR_LEN
|
||||
wasm.liquidation_price_js(retptr, addHeapObject(c), ptr0, len0)
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0]
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1]
|
||||
deferred2_0 = r0
|
||||
deferred2_1 = r1
|
||||
return getStringFromWasm0(r0, r1)
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16)
|
||||
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1)
|
||||
}
|
||||
}
|
||||
|
||||
function handleError(f, args) {
|
||||
try {
|
||||
return f.apply(this, args)
|
||||
|
Binary file not shown.
2
src/utils/health_computer/index_bg.wasm.d.ts
vendored
2
src/utils/health_computer/index_bg.wasm.d.ts
vendored
@ -14,9 +14,9 @@ export function max_swap_estimate_js(
|
||||
g: number,
|
||||
h: number,
|
||||
): void
|
||||
export function liquidation_price_js(a: number, b: number, c: number, d: number): void
|
||||
export function allocate(a: number): number
|
||||
export function deallocate(a: number): void
|
||||
export function requires_stargate(): void
|
||||
export function requires_iterator(): void
|
||||
export function interface_version_8(): void
|
||||
export function __wbindgen_malloc(a: number, b: number): number
|
||||
|
Loading…
Reference in New Issue
Block a user