mirror of
https://github.com/cerc-io/mars-interface.git
synced 2024-12-22 12:17:45 +00:00
commit
61d3db002e
42
README.md
42
README.md
@ -28,18 +28,17 @@ Copy `.env.example` to `.env` and modify the values to suit your needs.
|
|||||||
|
|
||||||
We allow the use of environment variables to be passed to the Docker container to specify custom endpoints for the app. The variables are:
|
We allow the use of environment variables to be passed to the Docker container to specify custom endpoints for the app. The variables are:
|
||||||
|
|
||||||
|
| Variable | Description | Default |
|
||||||
|Variable|Description|Default|
|
| --------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
||||||
|--------|-----------|-------|
|
| URL_OSMOSIS_GQL | The Osmosis Hive GraphQL endpoint to use | https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-hive-front/graphql |
|
||||||
|URL_OSMOSIS_GQL|The Osmosis Hive GraphQL endpoint to use|https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-hive-front/graphql|
|
| URL_OSMOSIS_REST | The Osmosis node REST endpoint to use | https://lcd-osmosis.blockapsis.com |
|
||||||
|URL_OSMOSIS_REST|The Osmosis node REST endpoint to use|https://lcd-osmosis.blockapsis.com|
|
| URL_OSMOSIS_RPC | The Osmosis node RPC endpoint to use | https://rpc-osmosis.blockapsis.com |
|
||||||
|URL_OSMOSIS_RPC|The Osmosis node RPC endpoint to use|https://rpc-osmosis.blockapsis.com|
|
| URL_OSMOSIS_TEST_GQL | The Osmosis Testnet Hive GraphQL endpoint to use | https://testnet-osmosis-node.marsprotocol.io/XF32UOOU55CX/osmosis-hive-front/graphql |
|
||||||
|URL_OSMOSIS_TEST_GQL|The Osmosis Testnet Hive GraphQL endpoint to use|https://testnet-osmosis-node.marsprotocol.io/XF32UOOU55CX/osmosis-hive-front/graphql|
|
| URL_OSMOSIS_TEST_REST | The Osmosis Testnet node REST endpoint to use | https://lcd.osmotest5.osmosis.zone |
|
||||||
|URL_OSMOSIS_TEST_REST|The Osmosis Testnet node REST endpoint to use|https://lcd.osmotest5.osmosis.zone|
|
| URL_OSMOSIS_TEST_RPC | The Osmosis Testnet node RPC endpoint to use | https://rpc.osmotest5.osmosis.zone |
|
||||||
|URL_OSMOSIS_TEST_RPC|The Osmosis Testnet node RPC endpoint to use|https://rpc.osmotest5.osmosis.zone|
|
| URL_NEUTRON_TEST_GQL | The Neutron Testnet Hive GraphQL endpoint to use | https://testnet-neutron-gql.marsprotocol.io/graphql |
|
||||||
|URL_NEUTRON_TEST_GQL|The Neutron Testnet Hive GraphQL endpoint to use|https://testnet-neutron-gql.marsprotocol.io/graphql|
|
| URL_NEUTRON_TEST_REST | The Neutron Testnet node REST endpoint to use | https://rest-palvus.pion-1.ntrn.tech |
|
||||||
|URL_NEUTRON_TEST_REST|The Neutron Testnet node REST endpoint to use|https://rest-palvus.pion-1.ntrn.tech|
|
| URL_NEUTRON_TEST_RPC | The Neutron Testnet node RPC endpoint to use | https://rpc-palvus.pion-1.ntrn.tech |
|
||||||
|URL_NEUTRON_TEST_RPC|The Neutron Testnet node RPC endpoint to use|https://rpc-palvus.pion-1.ntrn.tech|
|
|
||||||
|
|
||||||
**Sample Docker run command**
|
**Sample Docker run command**
|
||||||
|
|
||||||
@ -47,16 +46,15 @@ This command will start the container in interactive mode with port 3000 bound t
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run -it -p 3000:3000 \
|
docker run -it -p 3000:3000 \
|
||||||
-e NETWORK=mainnet \
|
-e URL_OSMOSIS_GQL=https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-hive-front/graphql \
|
||||||
-e URL_OSMOSIS_GQL=https://your-osmosis-hive-endpoint.com \
|
-e URL_OSMOSIS_REST=https://lcd-osmosis.blockapsis.com \
|
||||||
-e URL_OSMOSIS_REST=https://your-osmosis-rest-endpoint.com \
|
-e URL_OSMOSIS_RPC=https://rpc-osmosis.blockapsis.com \
|
||||||
-e URL_OSMOSIS_RPC=https://your-osmosis-rpc-endpoint.com \
|
-e URL_OSMOSIS_TEST_GQL=https://testnet-osmosis-node.marsprotocol.io/XF32UOOU55CX/osmosis-hive-front/graphql \
|
||||||
-e URL_OSMOSIS_TEST_GQL=https://your-osmosis-testnet-hive-endpoint.com \
|
-e URL_OSMOSIS_TEST_REST=https://lcd.osmotest5.osmosis.zone \
|
||||||
-e URL_OSMOSIS_TEST_REST=https://your-osmosis-testnet-rest-endpoint.com \
|
-e URL_OSMOSIS_TEST_RPC=https://rpc.osmotest5.osmosis.zone \
|
||||||
-e URL_OSMOSIS_TEST_RPC=https://your-osmosis-testnet-rpc-endpoint.com \
|
-e URL_NEUTRON_TEST_GQL=https://testnet-neutron-gql.marsprotocol.io/graphql \
|
||||||
-e URL_NEUTRON_TEST_GQL=https://your-neutron-testnet-hive-endpoint.com \
|
-e URL_NEUTRON_TEST_REST=https://rest-palvus.pion-1.ntrn.tech \
|
||||||
-e URL_NEUTRON_TEST_REST=https://your-neutron-testnet-rest-endpoint.com \
|
-e URL_NEUTRON_TEST_RPC=https://rpc-palvus.pion-1.ntrn.tech marsprotocol/interface:latest
|
||||||
-e URL_NEUTRON_TEST_RPC=https://your-neutron-testnet-rpc-endpoint.com marsprotocol/interface:latest
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3. Text and translations
|
## 3. Text and translations
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "mars",
|
"name": "mars",
|
||||||
"homepage": "./",
|
"homepage": "./",
|
||||||
"version": "1.5.0",
|
"version": "1.5.1",
|
||||||
"license": "SEE LICENSE IN LICENSE FILE",
|
"license": "SEE LICENSE IN LICENSE FILE",
|
||||||
"private": false,
|
"private": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -58,6 +58,8 @@ export const BreakdownTable = (props: Props) => {
|
|||||||
: 'borrowedSecondary'
|
: 'borrowedSecondary'
|
||||||
const borrowedChange =
|
const borrowedChange =
|
||||||
props.newPosition.amounts[borrowKey] - props.prevPosition.amounts[borrowKey]
|
props.newPosition.amounts[borrowKey] - props.prevPosition.amounts[borrowKey]
|
||||||
|
const borrowDenom =
|
||||||
|
borrowKey === 'borrowedPrimary' ? props.vault.denoms.primary : props.vault.denoms.secondary
|
||||||
|
|
||||||
const containerClasses = classNames([
|
const containerClasses = classNames([
|
||||||
props.className,
|
props.className,
|
||||||
@ -79,7 +81,7 @@ export const BreakdownTable = (props: Props) => {
|
|||||||
break
|
break
|
||||||
case AmountType.DEBT:
|
case AmountType.DEBT:
|
||||||
amount = props.newPosition.amounts[borrowKey]
|
amount = props.newPosition.amounts[borrowKey]
|
||||||
denom = props.vault.denoms.secondary
|
denom = borrowDenom
|
||||||
break
|
break
|
||||||
case AmountType.POSITION_PRIMARY:
|
case AmountType.POSITION_PRIMARY:
|
||||||
amount = props.newPosition.amounts.primary + props.newPosition.amounts.borrowedPrimary
|
amount = props.newPosition.amounts.primary + props.newPosition.amounts.borrowedPrimary
|
||||||
|
@ -59,8 +59,8 @@ export const useEditPosition = (props: Props) => {
|
|||||||
amount: (secondaryAmount + borrowedSecondaryAmount).toString(),
|
amount: (secondaryAmount + borrowedSecondaryAmount).toString(),
|
||||||
})
|
})
|
||||||
|
|
||||||
let primaryAfterSwap = primaryAmount + borrowedPrimaryAmount
|
let primaryAfterSwap = new BigNumber(primaryAmount).plus(borrowedPrimaryAmount)
|
||||||
let secondaryAfterSwap = secondaryAmount + borrowedSecondaryAmount
|
let secondaryAfterSwap = new BigNumber(secondaryAmount).plus(borrowedSecondaryAmount)
|
||||||
|
|
||||||
// If difference is larger than threshold, initiate a swap
|
// If difference is larger than threshold, initiate a swap
|
||||||
const difference = primaryBaseAmount - secondaryBaseAmount
|
const difference = primaryBaseAmount - secondaryBaseAmount
|
||||||
@ -91,8 +91,8 @@ export const useEditPosition = (props: Props) => {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
primaryAfterSwap = primaryAfterSwap + primaryAmountChange
|
primaryAfterSwap = primaryAfterSwap.plus(primaryAmountChange)
|
||||||
secondaryAfterSwap = secondaryAfterSwap + secondaryAmountChange
|
secondaryAfterSwap = secondaryAfterSwap.plus(secondaryAmountChange)
|
||||||
}
|
}
|
||||||
const coins: Coin[] = [
|
const coins: Coin[] = [
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@ export const useMarsOracle = () => {
|
|||||||
const priceSourcesQuery = getContractQuery(
|
const priceSourcesQuery = getContractQuery(
|
||||||
'price_sources',
|
'price_sources',
|
||||||
oracleAddress || '',
|
oracleAddress || '',
|
||||||
'{ price_sources: {} }',
|
'{ price_sources: {limit: 20} }',
|
||||||
)
|
)
|
||||||
|
|
||||||
whitelistedAssets
|
whitelistedAssets
|
||||||
|
Loading…
Reference in New Issue
Block a user