Skip to content

Simulator - update order marginal price #361

@ashachaf

Description

@ashachaf
https://api.carbondefi.xyz/v1/simulator/create?base=0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599&quote=0xdAC17F958D2ee523a2206206994597C13D831ec7&buyMin=109225.56792047949&buyMax=122769.3617808012772277227722772277227722772277227722772277227722772277227722772277227722772277227723&buyBudget=155.997069&buyMarginal=109229.9506258411396266577834952409078728110120089673557876910663225347146511916065201267304049287508&sellMin=110317.8235996842849&sellMax=123997.05539860929&sellBudget=4&sellMarginal=110322.2501320995510229243613301933169515391221290570293455679769857600617977035225853279977089780382&start=1748390400&end=1764028800&baseToken=0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599&quoteToken=0xdAC17F958D2ee523a2206206994597C13D831ec7

currently, this is what happens:

  1. api call includes buyMarginal and sellMarginal values
  2. backend ignores these values and use different values for internal calculations

updated: use the Pm values passed in the api for the internal calculations

for evaluation, please generate the response json which is returned from this api call in both cases (with current settings and updated ones).

especially trying to identify the different values for this day:

  "date": 1752192000,
  "price": "116796.4157084988107365823398476479696540606360583738012705691777433233731499249713986869166074465786",
  "sell": "116796.415708498810736582",
  "buy": "122523.82305723967744",
  "baseBalance": "2.087309414008134066",
  "basePortion": "243790.258030757077246332",
  "quoteBalance": "217055.576114188404933715",
  "quotePortion": "217055.576114188404933715",
  "portfolioValueInQuote": "460845.834144945482180046",
  "hodlValueInQuote": "467341.659902995242946329",
  "portfolioOverHodlInPercent": "-1.389952215986497017"
}```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions