MMQLEngine/specifications/0002_statement_structurs.md

870 B

Example Statement

BUY 1 SHARES OF BTC_ETF
  FOR 10 USD
  FROM "MyBrokerAccount"
  WITH LIMIT OF PURCHASING_POWER( "MyBrokerAccount", "QQQ" )
  FOR EVERY
    1 BTC OF USD_BTC SOLD
        FROM "CoinBase"

Yield Structure

{
    Statement: BUY
    Product: {
        Name: BTC_ETF
        Amount: {
            Value: 1
            Unit: SHARES
        }
    }
    For: {
        Value: 10
        Unit: USD
    }
    From: MyBrokerAccount
    Limit: {
        Amount: {
            Func: {
                Name: PURCHASING_POWER
                Params [
                    MyBrokerAccount
                    QQQ
                ]
            }
        }
    }
    When: [{
        Event: SOLD
        Params: {
            Amount: {
                Value: 1
                Unit: BTC
            }
            From: CoinBase
        }
    }]
}