BlockPo / BlockPo-to-Tradelayer

Incubation Repo for the TradeLayer protocol, 0.2.0
http://www.tradelayer.org
Other
8 stars 8 forks source link

Notional put in as 100 coming out at 14.10065408 #485

Open patrickdugan opened 1 year ago

patrickdugan commented 1 year ago

Some bizarre function going on with contract creation in

oracle address: QhcCeGsVM2j8VN2ceLAvRCW4ido9ZbuNus name: "testOracle10" blocks until expiration: 2048 notional size: 100 collateral currency: 10 margin requirement: 0.1 backup address: Qf24J987GHthHteBTFWugzhdgLHPiDuJpT quoting: 1 KYC: [0]

Result:


  {
    "propertyid": 10,
    "name": "testOracle10",
    "data": "",
    "url": "",
    "issuer": "QhcCeGsVM2j8VN2ceLAvRCW4ido9ZbuNus",
    "creationtxid": "bccb49db3a3d5fc8a25e888fa5c36d6dc886da91cc65ab523b5693cea91bbbcc",
    "creation block": 2434520,
    "notional size": "14.10065408",
    "collateral currency": "10",
    "margin requirement": "0.1",
    "blocks until expiration": "2048",
    "last high price": "0",
    "last low price": "0",
    "last close price": "0"
  }

100 divided by 14.100654... = 7.09186959929 Why is this coming up? Does it have to do with logic around quoting? We may need (perhaps as a separate ticket) to put bracket logics around what kind of asset is involved in the contract, at least for native. Oracles can be wacky and badly formed, but if a contract's collateral is the numerator is must be linear and if the collateral is the denominator, it must be inverse quoted. Maybe 7.0918... is the contract collateral's mark price?