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

make document id optional from get_aggregate_price (Version: 2.3.0) #5214

Open
shortthefomo opened this issue Dec 5, 2024 · 0 comments
Open
Labels
Feature Request Used to indicate requests to add new features

Comments

@shortthefomo
Copy link

shortthefomo commented Dec 5, 2024

Summary

make the document id when looking up the get_aggregate_price optional

Motivation

My oracle uses websockets and I only publish a price when there is trade. Reason is the WebSocket could have gone dead and if I just keep publishing the last price, I would be pushing a false value. Due to this my pairs are not consistent in the document ID's, for example XRPDOT here could be in document 5 the next time I publish the values (if there was another token that got a value that has not been traded since the last push) could be in document 6 the next time round.
Screenshot 2024-12-05 at 7 19 00 PM

Solution

make the document ID from the get_aggregate_price optional, currently I have to hope that developers understand that they need to look for a published value from my oracle by doing this....... its horrible.

const command = {
  'command': 'get_aggregate_price',
  'ledger_index': 'current',
  'base_asset': 'XRP',
  'quote_asset': code,
  'trim': 20,
  'oracles': [
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 0
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 1
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 2
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 3
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 4
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 5
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 6
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 7
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 8
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 9
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 10
    },
    {
      'account': 'roosteri9aGNFRXZrJNYQKVBfxHiE5abg',
      'oracle_document_id': 11
    }
  ]
}

Paths Not Taken

I've not been able to figure a decent solution to this issue, as there also is no option to push a NULL value of sorts. Where by possibly that way I could have the pairs be static in their respective documents.

@shortthefomo shortthefomo added the Feature Request Used to indicate requests to add new features label Dec 5, 2024
@shortthefomo shortthefomo changed the title remove document id from get_aggregate_price (Version: 2.3.0) make document id optional from get_aggregate_price (Version: 2.3.0) Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Used to indicate requests to add new features
Projects
None yet
Development

No branches or pull requests

1 participant