Skip to content

Commit

Permalink
LiquidityProxy empty quote handle (#78)
Browse files Browse the repository at this point in the history
* fix

* Update Jenkinsfile

---------

Co-authored-by: Nikita Zaporozhets <95526886+f33r0@users.noreply.github.com>
  • Loading branch information
pakrentos and f33r0 authored Jun 1, 2023
1 parent 12877cf commit ef737b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ def pipeline = new org.docker.AppPipeline(steps: this,
dockerImageName: 'sora2/pricing-server',
dockerRegistryCred: 'bot-sora2-rw',
secretScannerExclusion: '.*docker-compose.yml',
dockerImageTags: ['fix/liquidity-proxy-none-quote-handling':'fix-quote'],
gitUpdateSubmodule: true)
pipeline.runPipeline()
14 changes: 10 additions & 4 deletions run_node_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,11 @@ def get_end(substrate: SubstrateInterface):
params = [0, XOR_ID, other_asset, '1000000000000000000', 'WithDesiredInput', [], 'Disabled', block_hash]
result = substrate.rpc_request('liquidityProxy_quote', params)
pair = pairs[swap[1], swap[2]]
amount = int(result['result']['amount']) / DENOM
pair.quote_price = amount if swap[1] == xor_id_int else 1 / amount
if result['result'] is not None:
amount = int(result['result']['amount']) / DENOM
pair.quote_price = amount if swap[1] == xor_id_int else 1 / amount
else:
pair.quote_price = None
session.add(pair)
parsed_swaps.append(swap[3])
if swap[0] == 1:
Expand All @@ -499,8 +502,11 @@ def get_end(substrate: SubstrateInterface):
params = [1, XSTUSD_ID, other_asset, '1000000000000000000', 'WithDesiredInput', [], 'Disabled', block_hash]
result = substrate.rpc_request('liquidityProxy_quote', params)
pair = pairs[swap[1], swap[2]]
amount = int(result['result']['amount']) / DENOM
pair.quote_price = amount if swap[1] == xstusd_id_int else 1 / amount
if result['result'] is not None:
amount = int(result['result']['amount']) / DENOM
pair.quote_price = amount if swap[1] == xstusd_id_int else 1 / amount
else:
pair.quote_price = None
session.add(pair)
parsed_swaps.append(swap[3])
if parsed_swaps or burns:
Expand Down

0 comments on commit ef737b9

Please sign in to comment.