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:
parent
551f4ab7ee
commit
290e43199c
@ -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 {
|
||||||
|
@ -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)
|
||||||
|
@ -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 %
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user