1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

change weights (#169)

* change weights

* new defaults

* your liquidity fix

Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
This commit is contained in:
mihaisc 2020-10-30 12:50:50 +02:00 committed by GitHub
parent 551f4ab7ee
commit 290e43199c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -73,7 +73,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
const totalLiquidityInOcean = price?.ocean + price?.datatoken * price?.value const totalLiquidityInOcean = price?.ocean + price?.datatoken * price?.value
useEffect(() => { useEffect(() => {
if (!ocean || !accountId || !price || !price.value) return if (!ocean || !accountId || !price) return
async function init() { async function init() {
try { try {

View File

@ -42,6 +42,8 @@ export default function Dynamic({
// Calculate firstPrice whenever user values change // Calculate firstPrice whenever user values change
useEffect(() => { useEffect(() => {
if (`${oceanAmount}` === '') return
const tokenAmountOut = 1 const tokenAmountOut = 1
const weightRatio = new Decimal(weightOnDataToken).div( const weightRatio = new Decimal(weightOnDataToken).div(
new Decimal(weightOnOcean) new Decimal(weightOnOcean)

View File

@ -22,9 +22,9 @@ export const validationSchema = Yup.object().shape<PriceOptionsMarket>({
export const initialValues: PriceOptionsMarket = { export const initialValues: PriceOptionsMarket = {
price: 1, price: 1,
type: 'dynamic', type: 'dynamic',
dtAmount: 9, dtAmount: 10,
oceanAmount: 1, oceanAmount: 10,
weightOnOcean: '1', // 10% on OCEAN weightOnOcean: '5', // 50% on OCEAN
weightOnDataToken: '9', // 90% on datatoken weightOnDataToken: '5', // 50% on datatoken
swapFee: 0.1 // in % swapFee: 0.1 // in %
} }