Skip to content

Commit

Permalink
2 eth pools
Browse files Browse the repository at this point in the history
  • Loading branch information
taureau75 committed Jun 16, 2023
1 parent c9a0a6d commit c0e06d7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@ app.get('/prices', async (_, res) => {
})
})

app.get('/available_liqudity', async (_, res) => {
app.get('/available_liquidity', async (_, res) => {
return res.status(200).json({
solana: await getSolanaBalance(),
ethereum: await getEthereumBalance(),
bitcoin: await getBitcoinBalace()
sol: await getSolanaBalance(),
eth_sol: await getEthereumBalance(process.env.ETH_SOL_LIQUIDITY_ADDRESS),
eth_btc: await getEthereumBalance(process.env.ETH_BTC_LIQUIDITY_ADDRESS),
btc: await getBitcoinBalace()
})
})

Expand All @@ -144,8 +145,8 @@ async function getSolanaBalance () {
return solanaBalance / solana.LAMPORTS_PER_SOL
}

async function getEthereumBalance () {
const balance = await ethersProvider.getBalance(process.env.ETHEREUM_LIQUIDITY_ADDRESS)
async function getEthereumBalance (address) {
const balance = await ethersProvider.getBalance(address);
return new BigNumber(balance.toString()).div(1e18).toNumber()
}

Expand Down

1 comment on commit c0e06d7

@vercel
Copy link

@vercel vercel bot commented on c0e06d7 Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.