Skip to content

Commit

Permalink
✨Fixes decimal conversion for Starknet Fetcher (#66)
Browse files Browse the repository at this point in the history
* init ekubo amm price (on-off)

* fix: int in calldata

* fix: math error

* jediswap pool retrieval

* median

* adding base class for publisher

* adding session as fetch argument

* async/sync versions

* error message if pool empty

* async/sync mod

* off chain integration tests

* reverse pair def

* None for instance

* poe format

* fix: move poolkey to types

* ⬆️ 1.1.3

* fix: assets list decimals

* ⬆️ 1.1.4

---------

Co-authored-by: JordyRo1 <[email protected]>
  • Loading branch information
EvolveArt and JordyRo1 authored Jan 18, 2024
1 parent 30f2f30 commit 5260526
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pragma/core/mixins/offchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def build_publish_message(entries: List[SpotEntry], now: int, expiry: int) -> Ty
"message": {
"action": "Publish",
"entries": SpotEntry.serialize_entries(entries),
"timestamp": now,
"expiration": expiry,
# "timestamp": now,
# "expiration": expiry,
},
"types": {
"StarkNetDomain": [
Expand Down
3 changes: 2 additions & 1 deletion pragma/publisher/fetchers/starknetamm.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,10 @@ def fetch_sync(self) -> List[Union[SpotEntry, PublisherFetchError]]:
return entries

def _construct(self, asset, result) -> SpotEntry:
price_int = int(result * (10 ** asset["decimals"]))
return SpotEntry(
pair_id=currency_pair_to_pair_id(asset["pair"][0], asset["pair"][1]),
price=result,
price=price_int,
timestamp=int(time.time()),
source=self.SOURCE,
publisher=self.publisher,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pragma-sdk"
version = "1.1.3"
version = "1.1.4"
authors = ["0xevolve <[email protected]>"]
description = "Core package for rollup-native Pragma Oracle"
readme = "README.md"
Expand Down

0 comments on commit 5260526

Please sign in to comment.