Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add amount from collateral Trade in USD #72

Closed
davidalbela opened this issue Oct 20, 2020 · 0 comments · Fixed by #73
Closed

Add amount from collateral Trade in USD #72

davidalbela opened this issue Oct 20, 2020 · 0 comments · Fixed by #73
Assignees

Comments

@davidalbela
Copy link
Contributor

Add a new field in FPMMTrade entity to get the collateralAmount in USD values.

davidalbela added a commit to davidalbela/omen-subgraph that referenced this issue Oct 20, 2020
Add a new field `collateralAmountUSD` as BigDecimal type to calculate
the value of `collateralAmount` in USD value at the moment of the trade.

Resolves: protofire#72
kadenzipfel added a commit that referenced this issue Nov 24, 2020
* Add `FPMMTrade` entity into the subgraph

* Fix TradeType enum and FPMMTrade creator type

* Add custom trade subgraph to package info

* Set `outcomeIndex` to type BigInt

* Rename FPMMTrade attributes to `amount` and `outcomeTokensTrade`

* Set FPMMTrade `creator` attribute to type string

* Rename FpmmTrade attributes to `collateralAmount` and `outcomeTokensTraded`

* Set package deployments to protofire

* Fix omen subgraphs name

* Add tradeNonce to Account

  * Increment the `tradeNonce` on every sell or buy event.

* Set package deployments to protofire

* Update Reality.eth adapter

* Add RealitioScalarAdapter to deployment

* Add ScalarQuestionLink entity

* Refine testing workflow, adding test-fresh-deploy task

* Enable standard uint questions from Realitio to be indexed

* WIP scalar market tests

* Preannounced scalar market links now enable scalar markets

* Scalar market link can be established after condition created

* Add more details about different question IDs when using scalar markets

* Fully switch to Yarn

* Use switch task runner from NPM to Yarn

* Fix set `account.tradeNonce` on recordTrade

* Set package deployments to protofire

* Deploy RealitioScalarAdapter on Rinkeby and Mainnet

* Fix Omen Verified Markets on Rinkeby

The previous version of the list used a buggy centralized arbitrator. This fixes the issue.

* Copy bounds to condition and FPMM entities

* Set rinkeby and mainnet deployments to protofire

* Fix repository endpoint on package.json

* Add USD amount in FPMMTrade entity

Add a new field `collateralAmountUSD` as BigDecimal type to calculate
the value of `collateralAmount` in USD value at the moment of the trade.

Resolves: #72

* Add FPMM Liquidity entity

Add a new `FPMMLiquidity` entity with the record of every
`FPMMFundingAdded` and `FPMMFundingRemoved` events from all
FixedProductMarketMakert contracts.

Add a new `fpmm.calculateLiquidityParameter` method to calculate with the
`nthRoot` the collateral liquidity parameter.

Resolves: #71

* Rename field `collateralTokenAmount`

* Assignments for `collateralUSDPrice` and `collateralAmountUSD` into if conditional block. Set to `zeroDec` on declaration.

* Add FPMM Liquidity entity

Add a new `FPMMLiquidity` entity with the record of every
`FPMMFundingAdded` and `FPMMFundingRemoved` events from all
FixedProductMarketMakert contracts.

Add a new `fpmm.calculateLiquidityParameter` method to calculate with the
`nthRoot` the collateral liquidity parameter.

Resolves: #71

* Rename field `collateralTokenAmount`

* Add `additionalLiquidityParameter` Liquidity field

Add `additionalLiquidityParameter` field with the
`calculateLiquidityParameter` value.
Replace `collateralTokenAmount` to max/min value from
`outcomeTokenAmounts` list.
Add new `utils/Math.ts` file with max and min methods for BigInt[].

* Fix call as `recordFPMMLiquidity` BigInt parameter to `fromI32(0)`

* Add Outcome token marginal price to Trade entity

Set the old and new values for the `OutcomeTokenMarginalPrices` of the
selected outcome on the `FPMMBuy` and `FPMMSell` events to store that
values on FPMMTrade entity.

* Use original ConditionalTokens deployed on Rinkeby (#76)

* Add cast to `Array<BigDecimal>` to new and old `outcomeTokenMarginalPrices`

* Add transaction Hash to Trade and Liquidity entities

* Merge FpmmLiquidity and FpmmTrade #77 (#81)

* Add CollateralAmountUSD, FpmmType and TransactionHash to FpmmTransaction

* Add Answer event logic

* Add the TokenList entity for DxTokenRegister contract

* fix: add ERC20Details abi to DXTokenRegistry

Co-authored-by: David Albela Pérez <3659067+davidalbela@users.noreply.github.com>
Co-authored-by: Mariano Aguero <mariano.aguero@altoros.com>
Co-authored-by: Alan Lu <alanlu1023@gmail.com>
Co-authored-by: Matheus Faria de Alencar <mtsalenc@gmail.com>
Co-authored-by: Astro <bramchen77@outlook.com>
Co-authored-by: Thomas Pulber <corkus@pm.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants